code grant access token migration

payalgilda
Participant I

I am trying to migrate access tokens from org:a to or org:b using https://github.com/gahana/edge-token-import. The tokens are generated using the authorization code grant type. And they are long-lived tokens. However, to add the token using ExternalAccessToken and authorization_code grant type, you still need a valid authorization code in OAuthv2 policy.

Has anyone done this before without using authorization code? Is there any other way to do this?

Thank you!

1 2 181
2 REPLIES 2

You are correct that there is no way that I am aware to import tokens that are of the authorization code grant type without a valid authorization code. Since you are importing existing tokens as part of a migration my suggestion is to simply use the password grant type on import. The functionality of the tokens will work the same and allow users to take advantage of the imported refresh tokens to get new access tokens. This, of course, doesn't stop you from using the authorization code flow when users need to get authenticate to get access and refresh tokens.

Thanks @gregkuelgen.
I managed to import access tokens and refresh tokens using the authorization code grant.