我有一个应用程序,一个web应用程序(启用oauth ),一个android应用程序(需要访问web应用程序中的rest资源)。
我正在尝试实现spring-oauth2,例如oauth(最新的一个没有jwt) spring引导示例project.The项目有以下客户端配置
security.oauth2.client.clientId: acme
security.oauth2.client.clientSecret: acmesecret
security.oauth2.client.authorized-grant-types: authorization_code,refresh_token,password
security.oauth2.client.scope: openid因此,逻辑流类似于(如果我错了请更正)用户尝试访问ui应用程序->zuul代理重定向(带有客户端详细信息)到身份验证服务器->使用凭据登录(受保护的/authorize url)->授权作用域->随令牌/授权代码返回。
如何消除用户授权步骤(出于android应用程序的目的,我希望资源所有者分摊),.I更改了我的客户端配置如下
clients.inMemory().withClient("****").secret("*****").authorities("ROLE_USER")
.authorizedGrantTypes("password", "refresh_token").scopes("read", "write");但是我从authserver应用程序(DefaultRedirectResolver.java)中得到了错误。
“redirect_uri只能用于隐式或authorization_code授予类型。”
如果我在我的web-ui应用程序中有下面的security.oauth属性
security:
oauth2:
client:
accessTokenUri: http://localhost:9097/uaa/oauth/token
userAuthorizationUri: http://localhost:9097/uaa/oauth/authorize
clientId: ****
clientSecret: ****
resource:
userInfoUri: http://localhost:9097/uaa/user对于单点登录,是否可以使用资源所有者密码方法?如果是这样的话,作为配置的一部分,我应该更改什么?
发布于 2016-01-20 20:57:55
“redirect_uri只能用于隐式或authorization_code授予类型。”
我不确定"redirect_uri“,但我不认为您不能使用密码流获得一个单独的登录。SSO是通过在授权服务器上创建一个会话来实现的,这样如果授权服务器已经有了经过身份验证的会话,那么客户机(无论是相同的还是不同的)将不必再次进行身份验证。密码流不会在身份验证server...it上创建会话,只会获取令牌。
发布于 2019-02-07 21:49:47
必须在authorization_code ()上指定implicit或.authorizedGrantTypes授予类型,因为它们也是重定向类型。
clients.inMemory().withClient("****").secret("*****").authorities("ROLE_USER")
.authorizedGrantTypes("authorization_code", "password", "refresh_token").scopes("read", "write");或
clients.inMemory().withClient("****").secret("*****").authorities("ROLE_USER")
.authorizedGrantTypes("implicit", "password", "refresh_token").scopes("read", "write");https://stackoverflow.com/questions/34908943
复制相似问题