【发布时间】:2017-04-24 07:26:26
【问题描述】:
您好,我正在寻求有关 Spring Security 的帮助,我有一个 Spring REST API 服务于 IOS 和 Android 堆栈,我们有一个用于登录应用程序的 oauth/token 端点,在确认后它会发回令牌。它是一个开箱即用的弹簧安全类 org.springframework.security.oauth2.provider.endpoint。我试图在响应中发送来自与用户相关的 api 的附加信息,以在登录时合并来自移动设备的 api 调用。我不知道该怎么做,或者最好的方法是什么......我应该创建一个新的 TokenEndpoint 类吗?这就是我为 spring-security 配置的一些 XML 的方式。
<!-- OAUTH CONFIGS -->
<bean id="oauthAuthenticationEntryPoint" class="org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint">
<property name="realmName" value="hcnavigator" />
</bean>
<bean id="clientCredentialsTokenEndpointFilter" class="org.springframework.security.oauth2.provider.client.ClientCredentialsTokenEndpointFilter">
<property name="authenticationManager" ref="clientAuthenticationManager" />
</bean>
<bean id="accessDecisionManager" class="org.springframework.security.access.vote.UnanimousBased">
<constructor-arg>
<list>
<bean class="org.springframework.security.oauth2.provider.vote.ScopeVoter" />
<bean class="org.springframework.security.access.vote.RoleVoter" />
<bean class="org.springframework.security.access.vote.AuthenticatedVoter" />
</list>
</constructor-arg>
</bean>
【问题讨论】:
标签: java spring spring-security oauth