java - Requesting multiple scopes in Spring Security Oauth2 version 2.0.7.RELEASE -


we have application using spring-security-oauth2:1.0. trying change newer version, spring-security-oauth2:2.0.7.release. if don't specify scope or if specify single scope, application works fine. have problem while requesting multiple scopes read,write, used work in previous version.

the client requesting has read,write , trust permissions.

when using spring-security-oauth2:1.0, token used call like

http://localhost:8080/oauth/token?grant_type=password&client_id=ws&client_secret=secret&scope=read,write&username=user@abc.com&password=temp123

if see scope parameter scope=read,write, requesting way used token scope read , write.

if try same thing oauth2 version 2.0.7.release(with post request though), invalid scope exception because tokenrequestis taking read,write single scope. client requesting has read,write , trust permissions read,write not 1 of them.

if try scope=write or scope=read, works fine because read or write part of client's scope.

if want request multiple scopes in oauth2 2.0.7.release, how do that?

i found correct way this. instead of comma separated scopes, have use + separate scopes.

ex: read+write , write+trust

so following post request worked fine.

http://localhost:8080/oauth/token?grant_type=password&client_id=ws&client_secret=secret&scope=read+write&username=user@abc.com&password=temp123

i hope others :)


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -