function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sivapriya RajeshwerSivapriya Rajeshwer 

Auth.Authtoken.getAccessToken null issue

We have configured an auth provider using open id connect and created registration handler to create and update user. I have a requirement to get the ID Token as well. so I tried to use String token = Auth.AuthToken.getAccessToken(authproviderId, 'Open ID connect') where authproviderId is the ID of the provider that I configured. This token value always returns null. Can anyone help me with this issue? Appreciate your response. Thanks!
Peter Minetree 9Peter Minetree 9
Change 'connect' to 'Connect'.  
David Tissen 11David Tissen 11
I got the Answer from here: Stackoverflow (https://salesforce.stackexchange.com/questions/321814/custom-rest-controller-to-access-auth-authtoken-getaccesstoken-returning-null)

Simple Answer is: Open Authentication Provider, open on the OAuth-Only Initialization URL, login. Now you get the Accesstoken!