官术网_书友最值得收藏!

  • OAuth 2.0 Cookbook
  • Adolfo Eloy Nascimento
  • 119字
  • 2021-07-08 09:35:06

There's more...

For this recipe, we did not configure the base URL, which must be done to avoid issues when running your application behind a proxy. To do so, you might add the following bean declaration inside GoogleConfigurerAdapter:

@Bean 
public ConnectController connectController( 
      ConnectionFactoryLocator locator, 
      ConnectionRepository repository) { 
 
      ConnectController controller =  
            new ConnectController(locator, repository); 
      controller.setApplicationUrl("http://localhost:8080"); 
      return controller; 
} 

Do not forget to define the same redirect URL for the OAuth 2.0 Provider and to make all the communications through TLS/SSL.

To improve security configurations, you might use a database to store all users and respective credentials being held in a cryptographically manner (these features are provided by Spring Security and can be read about in the official documents at https://projects.spring.io/spring-security/).

主站蜘蛛池模板: 绥德县| 元阳县| 灵川县| 运城市| 共和县| 许昌市| 武义县| 五寨县| 吐鲁番市| 宾阳县| 理塘县| 潼关县| 沙洋县| 大埔区| 南康市| 台中县| 安义县| 威远县| 通许县| 青铜峡市| 且末县| 开鲁县| 安徽省| 卫辉市| 古交市| 芦溪县| 荔浦县| 蕲春县| 林州市| 六安市| 乳山市| 温州市| 永和县| 洪洞县| 加查县| 肇源县| 武安市| 托里县| 白水县| 喜德县| 祁阳县|