I'm trying to use Keycoak as identity provider
for SSO
.
Following salesforce help example , I managed to create the login page, redirection, and the user can login succesfulyy , however I wasn't able to obtain access token.
I tried the following inside AutocreatedRegHandler
:
string accessToken = Auth.AuthToken.getAccessToken(AuthProviderId, 'Open ID Connect');
System.debug('accessToken :' + accessToken );
but accessToken
returns null
hence authentication
is not successful.
I also added Auth provider's scoop but nothing changed.
How to get access_token
?