diff --git a/.changeset/sour-laws-walk.md b/.changeset/sour-laws-walk.md new file mode 100644 index 0000000000..073e3dc6a8 --- /dev/null +++ b/.changeset/sour-laws-walk.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': patch +--- + +Export Azure Easy Auth provider so it can actually be used. diff --git a/docs/auth/microsoft/azure-easyauth.md b/docs/auth/microsoft/azure-easyauth.md index 4daf0851f0..8ea626288c 100644 --- a/docs/auth/microsoft/azure-easyauth.md +++ b/docs/auth/microsoft/azure-easyauth.md @@ -1,10 +1,12 @@ --- -id: azure-easy-auth +id: easy-auth title: Azure EasyAuth Provider -sidebar_label: Azure EasyAuth +sidebar_label: Azure Easy Auth description: Adding Azure's EasyAuth Proxy as an authentication provider in Backstage --- +The Backstage `core-plugin-api` package comes with a Microsoft authentication provider that can authenticate users using Azure Active Directory for PaaS service hosted in Azure that support Easy Auth, such as Azure App Services. + ## Backstage Changes Add the following into your `app-config.yaml` or `app-config.production.yaml` file diff --git a/microsite/sidebars.json b/microsite/sidebars.json index 09727685a0..b3e6f07b0e 100644 --- a/microsite/sidebars.json +++ b/microsite/sidebars.json @@ -277,15 +277,16 @@ "items": [ "auth/auth0/provider", "auth/atlassian/provider", - "auth/bitbucket/provider", "auth/microsoft/provider", + "auth/microsoft/easy-auth", + "auth/bitbucket/provider", "auth/github/provider", "auth/gitlab/provider", "auth/google/provider", "auth/google/gcp-iap-auth", "auth/okta/provider", - "auth/onelogin/provider", - "auth/oauth2-proxy/provider" + "auth/oauth2-proxy/provider", + "auth/onelogin/provider" ] }, "auth/identity-resolver", diff --git a/mkdocs.yml b/mkdocs.yml index 4b5c2cf7a2..4a75c3f67f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -6,6 +6,7 @@ edit_uri: edit/master/docs plugins: - techdocs-core +# For sidebar navigation on https://backstage.io/, see `microsite/sidebars.json` nav: - Overview: - What is Backstage?: 'overview/what-is-backstage.md' diff --git a/plugins/auth-backend/api-report.md b/plugins/auth-backend/api-report.md index 7515083c09..81d6512155 100644 --- a/plugins/auth-backend/api-report.md +++ b/plugins/auth-backend/api-report.md @@ -229,6 +229,12 @@ export const defaultAuthProviderFactories: { [providerId: string]: AuthProviderFactory; }; +// @public (undocumented) +export type EasyAuthResult = { + fullProfile: Profile; + accessToken?: string; +}; + // @public (undocumented) export const encodeState: (state: OAuthState) => string; @@ -694,6 +700,19 @@ export const providers: Readonly<{ nameIdMatchingUserEntityName(): SignInResolver; }>; }>; + easyAuth: Readonly<{ + create: ( + options?: + | { + authHandler?: AuthHandler | undefined; + signIn: { + resolver: SignInResolver; + }; + } + | undefined, + ) => AuthProviderFactory; + resolvers: never; + }>; }>; // @public (undocumented) diff --git a/plugins/auth-backend/src/providers/azure-easyauth/index.ts b/plugins/auth-backend/src/providers/azure-easyauth/index.ts index 698092d73f..73abde5f37 100644 --- a/plugins/auth-backend/src/providers/azure-easyauth/index.ts +++ b/plugins/auth-backend/src/providers/azure-easyauth/index.ts @@ -15,4 +15,4 @@ */ export { easyAuth } from './provider'; -export type { EasyAuthResponse } from './provider'; +export type { EasyAuthResult } from './provider'; diff --git a/plugins/auth-backend/src/providers/azure-easyauth/provider.ts b/plugins/auth-backend/src/providers/azure-easyauth/provider.ts index 405ca9ed59..7da069f6ae 100644 --- a/plugins/auth-backend/src/providers/azure-easyauth/provider.ts +++ b/plugins/auth-backend/src/providers/azure-easyauth/provider.ts @@ -38,6 +38,7 @@ type Options = { resolverContext: AuthResolverContext; }; +/** @public */ export type EasyAuthResult = { fullProfile: Profile; accessToken?: string; diff --git a/plugins/auth-backend/src/providers/index.ts b/plugins/auth-backend/src/providers/index.ts index a922065fd8..8173a7fbc3 100644 --- a/plugins/auth-backend/src/providers/index.ts +++ b/plugins/auth-backend/src/providers/index.ts @@ -15,6 +15,7 @@ */ export type { AwsAlbResult } from './aws-alb'; +export type { EasyAuthResult } from './azure-easyauth'; export type { BitbucketOAuthResult, BitbucketPassportProfile, diff --git a/plugins/auth-backend/src/providers/providers.ts b/plugins/auth-backend/src/providers/providers.ts index aa630b7481..36a24f4f6c 100644 --- a/plugins/auth-backend/src/providers/providers.ts +++ b/plugins/auth-backend/src/providers/providers.ts @@ -32,6 +32,7 @@ import { onelogin } from './onelogin'; import { saml } from './saml'; import { AuthProviderFactory } from './types'; import { bitbucketServer } from './bitbucketServer'; +import { easyAuth } from './azure-easyauth'; /** * All built-in auth provider integrations. @@ -56,6 +57,7 @@ export const providers = Object.freeze({ okta, onelogin, saml, + easyAuth, }); /** @@ -73,6 +75,7 @@ export const defaultAuthProviderFactories: { okta: okta.create(), auth0: auth0.create(), microsoft: microsoft.create(), + easyAuth: easyAuth.create(), oauth2: oauth2.create(), oidc: oidc.create(), onelogin: onelogin.create(),