I am using your steps to “Integrate my app” for Angular. Using that method, how do I get the access_token?
I tried setting scope to “openid profile email” in the call client.loginWithRedirect. I don’t what observable I should subscribe to to get this information.
Dan,
I was able to make the necessary calls, thanks for your guidance. I wanted to confirm that getTokenSilently returns the access_token and getIdTokenClaims returns a JSON where the key exp contains the expiration. I did not see a key call id_token. Not sure where to get that from.
On a side note could your company please update the example at Auth0 Angular SDK Quickstarts: Login to include the following functions in auth.service.ts
As you can see in the following example in the doc for the library, getTokenSilently is used for getting the access token:
Auth0-spa-js does not have a built in function to get the id_token. Please see this thread that discusses the situation: You can get the raw id token by passing a raw param.
As for the example, can you please submit it as a PR to the respective repo, the managing team will have a better understanding of the needs of the particular framework, and we try to keep the repo specific discussions organized on GitHub.
Update: The raw id token is now available via this method:
$('#getIdTokenClaims').click(async () => {
const claims = await auth0.getIdTokenClaims();
// if you need the raw id_token, you can access it
// using the __raw property
const id_token = claims.__raw;
});