I implementing OAuth2 Authorization Server and Resource Server.
and there are many documents told me 'Authorization Server and Resource Server can be Separated or not'
i like MSA, so i decided Separating these Servers.
i saw many documents in Internet about this issue, but i cant proceed anymore in practice.
i'm using SpringBoot2.
- Scenario
- User Connected to My
ClientApplication. - Request to secured endpoint
/client/me - in
Client's Controller, if user has not authenticated, redirect toAuthorization Server's login endpoint/auth/oauth/authorize. - if user comes in my
ClientApp first, user will sign-up(not sign-in) in myAuthorization Server. - in
Authorization Server's sign-up page, user will input hisusername,realusername,passwordandemail. - user's account has issued, and user will sign-in via my
Authorization Server's login form. - if login succeed,
Clientwill Request toResource Server's/meendpoint withaccess-token, andResource Server's Controller that mapped as/mewill returnPrincipalorAuthenticationObject as REST API. Clientwill bind there REST API's results intoDefaultOAuth2UserorCustomOAuth2Userin mySecurityContext.
- User Connected to My
here is question.
As far as I know, Resource Server's /me endpoint will provide user's resources.
for example, realname or email etc.
but user has signed-up in Authorization Server, so all of information are saved in Authorization Server's Database.
my oauth2 servers are MSA. so DB has been separated too.
then, how can i setting email or realname to Principal or Authentication or CustomOAuth2User Object via Resource Server's /me endpoint?