# Production deploy with external auth provider in Forge App

**URL:** <https://community.developer.atlassian.com/t/production-deploy-with-external-auth-provider-in-forge-app/60083>\
**Category:** Forge\
**Tags:** forge-external-auth, environments\
**Created:** [July 22, 2022, 8:17am UTC](https://community.developer.atlassian.com/t/production-deploy-with-external-auth-provider-in-forge-app/60083 "2022-07-22T08:17:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![haipham](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@haipham](https://community.developer.atlassian.com/u/haipham)\
**Post date:** [July 22, 2022, 8:17am UTC](https://community.developer.atlassian.com/t/production-deploy-with-external-auth-provider-in-forge-app/60083/1 "2022-07-22T08:17:50Z")

</div>

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

```auto
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:

```auto
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:

```auto
forge providers configure

```

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

```auto
forge deploy -e production

```

and share my app via link distribute follow document [distribute app document](https://developer.atlassian.com/platform/forge/distribute-your-apps/)

At production I got error message:

```auto
could not retrieve access token from the provider

```

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

---

<div class="post-metadata">

**Author:** ![MichaelCooper](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/michaelcooper/32/44385_2.png) [@MichaelCooper](https://community.developer.atlassian.com/u/MichaelCooper)\
**Post date:** [August 10, 2022, 4:20am UTC](https://community.developer.atlassian.com/t/production-deploy-with-external-auth-provider-in-forge-app/60083/2 "2022-08-10T04:20:02Z")

</div>

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?

```auto
forge providers configure -e production

```

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