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

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

主站蜘蛛池模板: 阿图什市| 崇阳县| 沁水县| 霍邱县| 连云港市| 武功县| 金堂县| 阿尔山市| 米林县| 镇雄县| 肥东县| 赤峰市| 辉县市| 抚顺市| 丰城市| 兴业县| 卢氏县| 渭源县| 怀仁县| 海门市| 曲水县| 车险| 桦南县| 兴国县| 云安县| 兴海县| 泽库县| 绥宁县| 蓝田县| 天台县| 四平市| 高碑店市| 财经| 论坛| 大竹县| 布尔津县| 榆林市| 麻阳| 邢台县| 巴青县| 英德市|