How can I get the token to the front end angular application after successful redirection to the index.html page happens like
1. I have used
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
in my pom.xml
2. then I have added required properties in my application.properties file
3. I built the angular files and placed them under resources/static folder
现在重定向到auth-server和回调到application成功发生,但如何获取oauth2令牌并存储在angular应用程序中,这将对进一步调用有用
1条答案
按热度按时间y1aodyip1#
如果你有一个Angular应用程序,那么它就是客户端。它应该使用angular-auth-oidc-client或类似的方式来:
Spring REST API应用是资源服务器。它应该依赖于
spring-boot-starter-oauth2-resource-server
,而不是spring-boot-starter-oauth2-client
。请参考spring Boot 文档或查看those tutorials以了解有关配置Spring resource-servers的更多详细信息。