Production deploy with external auth provider in Forge App

My app have an external provider auth for Facebook login, my manifest:

providers:
  auth:
  - key: facebook
    name: Facebook
    scopes:
      - email
      - pages_show_list
      - pages_messaging
      - pages_manage_metadata
      - pages_read_engagement
      - pages_read_user_content
    type: oauth2
    clientId: xxx
    remotes:
      - facebook-oauth
    bearerMethod: authorization-header
    actions:
      authorization:
        remote: facebook-apis
        path: /dialog/oauth
        queryParameters:
          client_id: xxxx
          client_secret: xxxx
          grant_type: client_credentials
          response_type: code
          redirect_uri: https://id.atlassian.com/outboundAuth/finish
      exchange:
        remote: facebook-oauth
        path: /oauth/access_token
      retrieveProfile:
        remote: facebook-oauth
        path: /me
        resolvers:
          id: id
          displayName: name
remotes:
  - key: facebook-apis
    baseUrl: https://www.facebook.com/v14.0
  - key: facebook-oauth
    baseUrl: https://graph.facebook.com

My resolver function in index.js:

resolver.define('processFacebookProvider', async (req) => {
    try{
        const facebookProvider = api.asUser().withProvider("facebook","facebook-oauth");
        if(!(await facebookProvider.hasCredentials())){
            await facebookProvider.requestCredentials();
        }
        facebookProvider.listCredentials().then(
            data => {
              console.log(data)
            }
        )
        const response = await facebookProvider.fetch("/me/accounts?fields=id,name,access_token");
        
        if(response.ok){
            return await response.json();
        }
        return null;
    }catch(ex){
      console.log(ex)
        throw ex
    }    
    
})

I have config provider client_secret by command:

forge providers configure

It work perfectly at my Development Environment. But when I deploy to production by command:

forge deploy -e production

and share my app via link distribute follow document distribute app document

At production I got error message:

could not retrieve access token from the provider

After authenticate with Facebook and redirect to my app. Thanks for helping me!

Hi @haipham,

Thanks for trying out external authentication in Forge!

Without looking into your case specifically, can you please confirm if you configured the secret in production as well?

forge providers configure -e production

If you have, please let me know and I can try to help you further.