Backstage
    Preparing search index...

    An implementation of the ScmAuthApi that merges together OAuthApi instances to form a single instance that can handles authentication for multiple providers.

    // Supports authentication towards both public GitHub and GHE:
    createApiFactory({
    api: scmAuthApiRef,
    deps: {
    gheAuthApi: gheAuthApiRef,
    githubAuthApi: githubAuthApiRef,
    },
    factory: ({ githubAuthApi, gheAuthApi }) =>
    ScmAuth.merge(
    ScmAuth.forGithub(githubAuthApi),
    ScmAuth.forGithub(gheAuthApi, {
    host: 'ghe.example.com',
    }),
    )
    })

    Implements

    Index

    Methods

    • Creates a general purpose ScmAuth instance with a custom scope mapping.

      Parameters

      • authApi: OAuthApi
      • options: { host: string; scopeMapping: { default: string[]; repoWrite: string[] } }

      Returns ScmAuth

    • Creates a new ScmAuth instance that handles authentication towards Azure.

      The host option determines which URLs that are handled by this instance and defaults to dev.azure.com.

      The default scopes are:

      vso.build vso.code vso.graph vso.project vso.profile

      If the additional repoWrite permission is requested, these scopes are added:

      vso.code_manage

      Parameters

      • microsoftAuthApi: OAuthApi
      • Optionaloptions: { host?: string }

      Returns ScmAuth

    • Creates a new ScmAuth instance that handles authentication towards Bitbucket.

      The host option determines which URLs that are handled by this instance and defaults to bitbucket.org.

      The default scopes are:

      account team pullrequest snippet issue

      If the additional repoWrite permission is requested, these scopes are added:

      pullrequest:write snippet:write issue:write

      Parameters

      • bitbucketAuthApi: OAuthApi
      • Optionaloptions: { host?: string; scopeMapping?: { default?: string[]; repoWrite?: string[] } }

      Returns ScmAuth

    • Creates a new ScmAuth instance that handles authentication towards Bitbucket Server.

      The host option determines which URLs that are handled by this instance.

      The default scopes are:

      PUBLIC_REPOS REPO_READ

      If the additional repoWrite permission is requested, these scopes are added:

      REPO_WRITE

      Parameters

      • bitbucketAuthApi: OAuthApi
      • options: { host: string; scopeMapping?: { default?: string[]; repoWrite?: string[] } }

      Returns ScmAuth

    • Creates a new ScmAuth instance that handles authentication towards GitHub.

      The host option determines which URLs that are handled by this instance and defaults to github.com.

      The default scopes are:

      repo read:org read:user

      If the additional repoWrite permission is requested, these scopes are added:

      gist

      Parameters

      • githubAuthApi: OAuthApi
      • Optionaloptions: { host?: string }

      Returns ScmAuth

    • Creates a new ScmAuth instance that handles authentication towards GitLab.

      The host option determines which URLs that are handled by this instance and defaults to gitlab.com.

      The default scopes are:

      read_user read_api read_repository

      If the additional repoWrite permission is requested, these scopes are added:

      write_repository api

      Parameters

      • gitlabAuthApi: OAuthApi
      • Optionaloptions: { host?: string }

      Returns ScmAuth