Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 924 Bytes

File metadata and controls

27 lines (21 loc) · 924 Bytes

GitHub

** This is Android Only **

Read more about iOS restrictions here.

Go to OAuth Apps to create your app.

For the Authorization callback URL, choose something like com.myapp://oauthredirect and ensure you use com.myapp in your appAuthRedirectScheme in android/app/build.gradle.

const config = {
  redirectUrl: 'com.my.auth.app://oauthredirect',
  clientId: '<client-id>',
  clientSecret: '<client-secret>',
  scopes: ['identity'],
  serviceConfiguration: {
    authorizationEndpoint: 'https://github.com/login/oauth/authorize',
    tokenEndpoint: 'https://github.com/login/oauth/access_token',
    revocationEndpoint:
      'https://github.com/settings/connections/applications/<client-id>'
  }
};

// Log in to get an authentication token
const authState = await authorize(config);