java - Log into a Spring Security application using a 3rd party OAuth2 server -


i working on a web application secured spring security. new requirement users can log in using existing, 3rd party oauth2 server, based on authorization code grant, , use api exposed it. think of app e-banking site , 3rd party api banking back-end app calls list of accounts user, example.

important points:

  • the authorization server , resource server 1 , same , external application , out of control
  • my application has no way establish user's identity itself. user redirected different page log in and, if successful, application receives token use user. i'm guessing should store token in user's session , keep submitting whenever need call api.
  • the user in application, once authenticated, should roles based on oauth2 scope assigned server

questions:

  • isn't login flow explained above normal authorization code grant flow? if so, spring's rationale expecting me have logged in user before acquiring token? isn't act of acquiring token "logging in"? how know how log in user when whole purpose of authorization code grant not have user send credentials app directly?
  • spring wants me map user roles scopes... isn't exact opposite of expected? shouldn't receive scope signify user can , assign role in app based on that?
  • is possible configure server (and app) not ask user explicitly grant permissions app? reason app way user access 3rd party api (e.g. way list of bank accounts use e-banking site), using app (e-banking site), want able job (get list of accounts banking back-end).

yes, login flow explained correct. oauth2resttemplate - stores token in session.

but don't understand questions fully.

  1. do mean spring forces user logged authorization server before granting auth code? correct cause user allows app operations on behalf. how can grant without being logged in?

  2. i'm not sure spring forces map user roles scopes. isn't done in authorization server limit scopes can granted user? you're right - can use token scopes map them internal roles in app if needed.

  3. we used cloudfoundry uaa build oauth2 authorization server , has concept of auto-approved scopes (i.e. no explicit user approval needed). can take @ that.

we had same requirement , did our own custom authenticationfilter(mapped redirect_uri) exchanging received auth code access token , creating internal authentication received token , appropriate internal roles.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -