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

  • 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/).

主站蜘蛛池模板: 德州市| 宁陵县| 凤阳县| 西昌市| 仁化县| 扶余县| 彩票| 镶黄旗| 西青区| 怀远县| 林芝县| 萨迦县| 工布江达县| 长丰县| 信丰县| 犍为县| 滁州市| 康平县| 吴桥县| 香河县| 平凉市| 天津市| 新平| 阳春市| 阜南县| 延长县| 河池市| 新化县| 临高县| 闸北区| 香河县| 瑞丽市| 庆阳市| 岱山县| 石柱| 福建省| 比如县| 兰西县| 双峰县| 石河子市| 永定县|