Implementing Implicit Flow without Resource User Approval (or other alternative)?
I am developing an application to use OAuth 2.0 where I own both the client and provider/authentication servers. I'm using OAuth in case any future website outside of our organization would like to access our provider (RESTful API), but for my usage I do not need the full process of requiring users to allow access to the data. I would like to ideally use a token within Javascript, similar to the Implicit flow, so that I can make calls within jquery code. The data is very user-specific.
Is there a way to implement the Implicit flow using Spring Security without the user having to allow access to the resources? Or, alternatively, is there a way to implement the client credentials flow that will allow me to distinguish users and retrieve a token that can be used within Javascript? From what I can tell, if I use the token retrieved from using the client credentials mechanism within Javascript it could be used by anyone to get all users' data if they know the correct URL paths.
Both client and provider use the same SSO server for sign-in, but I do not have access to the password (just username), so I don't think the resource owner password grant type would be of much use.
Thanks.
That worked... question on Implicit Flow
Quote:
Originally Posted by
Dave Syer
There is a UserApprovalHandler that you can plug into the auth server to make whatever approval decision you want (including auto-approve per client for instance, so your internal clients get auto approved but external ones require the extra step). Example:
https://github.com/cloudfoundry/uaa/...alHandler.java. That would work with implicit or auth code flows. I wouldn't try and do anything with client credentials if it actually involves a user.
I got this working, thanks!
Another question maybe someone can answer related to the Implicit flow - can/does this grant type use a consumer secret, similar to the authentication code flow? If I setup Spring Security OAuth client details on the provider side with a secret, it seems to be ignored in the Implicit flow (i.e. if a secret is not supplied by the client, it can still get access).
Thanks.