- OAuth 2.0 Cookbook
- Adolfo Eloy Nascimento
- 169字
- 2021-07-08 09:35:04
There's more...
For this recipe, we didn't create any configuration class. But if you want to define the base URL for callback redirection that happens when using the OAuth 2.0 protocol, you need to create a configuration class to define a custom ConnectController bean, as presented in the following code:
@Configuration public class LinkedInConfiguration { @Bean public ConnectController connectController(ConnectionFactoryLocator locator, ConnectionRepository repository) { ConnectController controller = new ConnectController(locator, repository); controller.setApplicationUrl("http://localhost:8080"); return controller; } }
By doing such configurations, you avoid issues when the application runs behind a proxy. The redirect URI will be automatically generated using the request info which will be based on the application which might be running behind a proxy. This way, the OAuth 2.0 Provider won't be able to redirect to the right callback URL because it will be hidden by the proxy. The configuration presented previously allows you to define the proxy's URL.
Do not forget to define the same redirect URL at the OAuth 2.0 Provider and make all the communication through TLS/SSL.
- Photoshop智能手機APP UI設計之道
- Visual Basic程序開發(學習筆記)
- Rake Task Management Essentials
- Neo4j Essentials
- Mastering Python High Performance
- C++程序設計基礎教程
- 人人都懂設計模式:從生活中領悟設計模式(Python實現)
- 高級語言程序設計(C語言版):基于計算思維能力培養
- 執劍而舞:用代碼創作藝術
- PLC應用技術(三菱FX2N系列)
- Android應用案例開發大全(第二版)
- 一塊面包板玩轉Arduino編程
- HTML5秘籍(第2版)
- Visualforce Developer’s guide
- Android傳感器開發與智能設備案例實戰