Slackbot
10/20/2023, 10:52 AMgiangio
10/20/2023, 10:55 AMGroovy Duke
10/20/2023, 11:00 AMgiangio
10/20/2023, 11:01 AMgiangio
10/20/2023, 11:02 AMGroovy Duke
10/20/2023, 12:57 PMgetProviderName
getSocialId //used this for username
getScreenName /used this for email
DefaultApi20
getAccessTokenEndpoint //get this from config which is <cognito domain>/oauth2/token
etAuthorizationBaseUrl //get this from config which is <cognito domain>/oauth2/authorize
getAccessTokenExtractor //used OpenIdJsonTokenExtractor
OAuth2AbstractProviderService
getProviderID // whatever you want to call your provider, probably cognito.
getApiClass //points to your API implementtion
getProfileScope // come from config <cognito domain>/oauth2/userInfo
getScopeSeparator // not sure what this was for but we have " "
createSpringAuthToken // parses the OAuth2AccessToken to get the email and id that could be used to look up the user and puts them in a OAuth2SpringToken
we also have the flowing added to our login controller:
oauth2Exception
oauth2Success // takes the OAuth2AccessToken looks up the user and creates OAuth2SpringToken by calling createSpringAuthToken, adds the token to SecurityContextHolder.context.authentication, and redirects
as you've seen from the plugin you can register your implementation of OAuth2AbstractProviderService in the plugin groovy file or if you do the code inline in your app you can also do this in BootStrap.groovy
That should help you out some and maybe save you some time. Plus by going over this I found something that we were overriding that we didn't need to.giangio
10/20/2023, 4:19 PMGroovy Duke
10/20/2023, 4:22 PMgiangio
10/21/2023, 5:51 AM