diff --git a/.changeset/rare-insects-punch.md b/.changeset/rare-insects-punch.md
new file mode 100644
index 0000000000..d22b851abd
--- /dev/null
+++ b/.changeset/rare-insects-punch.md
@@ -0,0 +1,10 @@
+---
+'@backstage/app-defaults': minor
+'@backstage/core-app-api': minor
+'@backstage/core-components': minor
+'@backstage/core-plugin-api': minor
+'@backstage/test-utils': minor
+'@backstage/plugin-user-settings': minor
+---
+
+**BREAKING**: Removed deprecated `auth0AuthApiRef`, `oauth2ApiRef`, `samlAuthApiRef` and `oidcAuthApiRef` as these APIs are too generic to be useful. Instructions for how to migrate can be found at [https://backstage.io/docs/api/deprecations#generic-auth-api-refs](https://backstage.io/docs/api/deprecations#generic-auth-api-refs).
diff --git a/packages/app-defaults/src/defaults/apis.ts b/packages/app-defaults/src/defaults/apis.ts
index f26c298fb1..3f5cfc1c58 100644
--- a/packages/app-defaults/src/defaults/apis.ts
+++ b/packages/app-defaults/src/defaults/apis.ts
@@ -21,16 +21,13 @@ import {
ErrorAlerter,
GoogleAuth,
GithubAuth,
- OAuth2,
OktaAuth,
GitlabAuth,
- Auth0Auth,
MicrosoftAuth,
BitbucketAuth,
OAuthRequestManager,
WebStorage,
UrlPatternDiscovery,
- SamlAuth,
OneLoginAuth,
UnhandledErrorForwarder,
AtlassianAuth,
@@ -49,16 +46,12 @@ import {
oauthRequestApiRef,
googleAuthApiRef,
githubAuthApiRef,
- oauth2ApiRef,
oktaAuthApiRef,
gitlabAuthApiRef,
- auth0AuthApiRef,
microsoftAuthApiRef,
storageApiRef,
configApiRef,
- samlAuthApiRef,
oneloginAuthApiRef,
- oidcAuthApiRef,
bitbucketAuthApiRef,
atlassianAuthApiRef,
} from '@backstage/core-plugin-api';
@@ -197,46 +190,6 @@ export const apis = [
environment: configApi.getOptionalString('auth.environment'),
}),
}),
- createApiFactory({
- api: auth0AuthApiRef,
- deps: {
- discoveryApi: discoveryApiRef,
- oauthRequestApi: oauthRequestApiRef,
- configApi: configApiRef,
- },
- factory: ({ discoveryApi, oauthRequestApi, configApi }) =>
- Auth0Auth.create({
- discoveryApi,
- oauthRequestApi,
- environment: configApi.getOptionalString('auth.environment'),
- }),
- }),
- createApiFactory({
- api: oauth2ApiRef,
- deps: {
- discoveryApi: discoveryApiRef,
- oauthRequestApi: oauthRequestApiRef,
- configApi: configApiRef,
- },
- factory: ({ discoveryApi, oauthRequestApi, configApi }) =>
- OAuth2.create({
- discoveryApi,
- oauthRequestApi,
- environment: configApi.getOptionalString('auth.environment'),
- }),
- }),
- createApiFactory({
- api: samlAuthApiRef,
- deps: {
- discoveryApi: discoveryApiRef,
- configApi: configApiRef,
- },
- factory: ({ discoveryApi, configApi }) =>
- SamlAuth.create({
- discoveryApi,
- environment: configApi.getOptionalString('auth.environment'),
- }),
- }),
createApiFactory({
api: oneloginAuthApiRef,
deps: {
@@ -251,25 +204,6 @@ export const apis = [
environment: configApi.getOptionalString('auth.environment'),
}),
}),
- createApiFactory({
- api: oidcAuthApiRef,
- deps: {
- discoveryApi: discoveryApiRef,
- oauthRequestApi: oauthRequestApiRef,
- configApi: configApiRef,
- },
- factory: ({ discoveryApi, oauthRequestApi, configApi }) =>
- OAuth2.create({
- discoveryApi,
- oauthRequestApi,
- provider: {
- id: 'oidc',
- title: 'Your Identity Provider',
- icon: () => null,
- },
- environment: configApi.getOptionalString('auth.environment'),
- }),
- }),
createApiFactory({
api: bitbucketAuthApiRef,
deps: {
diff --git a/packages/app/src/identityProviders.ts b/packages/app/src/identityProviders.ts
index 49204d2b5e..5f8c0faf47 100644
--- a/packages/app/src/identityProviders.ts
+++ b/packages/app/src/identityProviders.ts
@@ -19,27 +19,12 @@ import {
gitlabAuthApiRef,
oktaAuthApiRef,
githubAuthApiRef,
- samlAuthApiRef,
microsoftAuthApiRef,
oneloginAuthApiRef,
- oauth2ApiRef,
- oidcAuthApiRef,
bitbucketAuthApiRef,
} from '@backstage/core-plugin-api';
export const providers = [
- {
- id: 'oidc-auth-provider',
- title: 'Oidc',
- message: 'Sign In using OpenId Connect',
- apiRef: oidcAuthApiRef,
- },
- {
- id: 'oauth2-auth-provider',
- title: 'OAuth 2.0',
- message: 'Sign In using OAuth 2.0',
- apiRef: oauth2ApiRef,
- },
{
id: 'google-auth-provider',
title: 'Google',
@@ -70,12 +55,6 @@ export const providers = [
message: 'Sign In using Okta',
apiRef: oktaAuthApiRef,
},
- {
- id: 'saml-auth-provider',
- title: 'SAML',
- message: 'Sign In using SAML',
- apiRef: samlAuthApiRef,
- },
{
id: 'onelogin-auth-provider',
title: 'OneLogin',
diff --git a/packages/core-app-api/api-report.md b/packages/core-app-api/api-report.md
index 3b53813615..17a9592523 100644
--- a/packages/core-app-api/api-report.md
+++ b/packages/core-app-api/api-report.md
@@ -16,7 +16,6 @@ import { AppConfig } from '@backstage/config';
import { AppTheme } from '@backstage/core-plugin-api';
import { AppThemeApi } from '@backstage/core-plugin-api';
import { atlassianAuthApiRef } from '@backstage/core-plugin-api';
-import { auth0AuthApiRef } from '@backstage/core-plugin-api';
import { AuthProviderInfo } from '@backstage/core-plugin-api';
import { AuthRequestOptions } from '@backstage/core-plugin-api';
import { BackstageIdentityApi } from '@backstage/core-plugin-api';
@@ -246,12 +245,6 @@ export class AtlassianAuth {
static create(options: OAuthApiCreateOptions): typeof atlassianAuthApiRef.T;
}
-// @public @deprecated
-export class Auth0Auth {
- // (undocumented)
- static create(options: OAuthApiCreateOptions): typeof auth0AuthApiRef.T;
-}
-
// @public
export type AuthApiCreateOptions = {
discoveryApi: DiscoveryApi;
diff --git a/packages/core-app-api/src/apis/implementations/auth/auth0/Auth0Auth.ts b/packages/core-app-api/src/apis/implementations/auth/auth0/Auth0Auth.ts
deleted file mode 100644
index d8f942b94b..0000000000
--- a/packages/core-app-api/src/apis/implementations/auth/auth0/Auth0Auth.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2020 The Backstage Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import { auth0AuthApiRef } from '@backstage/core-plugin-api';
-import { OAuth2 } from '../oauth2';
-import { OAuthApiCreateOptions } from '../types';
-
-const DEFAULT_PROVIDER = {
- id: 'auth0',
- title: 'Auth0',
- icon: () => null,
-};
-
-/**
- * Implements the OAuth flow to Auth0 products.
- *
- * @public
- * @deprecated Use {@link OAuth2} instead
- *
- * @example
- *
- * ```ts
- * OAuth2.create({
- * discoveryApi,
- * oauthRequestApi,
- * provider: {
- * id: 'auth0',
- * title: 'Auth0',
- * icon: () => null,
- * },
- * defaultScopes: ['openid', 'email', 'profile'],
- * environment: configApi.getOptionalString('auth.environment'),
- * })
- * ```
- */
-export default class Auth0Auth {
- static create(options: OAuthApiCreateOptions): typeof auth0AuthApiRef.T {
- const {
- discoveryApi,
- environment = 'development',
- provider = DEFAULT_PROVIDER,
- oauthRequestApi,
- defaultScopes = ['openid', `email`, `profile`],
- } = options;
-
- return OAuth2.create({
- discoveryApi,
- oauthRequestApi,
- provider,
- environment,
- defaultScopes,
- });
- }
-}
diff --git a/packages/core-app-api/src/apis/implementations/auth/auth0/index.ts b/packages/core-app-api/src/apis/implementations/auth/auth0/index.ts
deleted file mode 100644
index 9daed7d13e..0000000000
--- a/packages/core-app-api/src/apis/implementations/auth/auth0/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2020 The Backstage Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export { default as Auth0Auth } from './Auth0Auth';
diff --git a/packages/core-app-api/src/apis/implementations/auth/index.ts b/packages/core-app-api/src/apis/implementations/auth/index.ts
index 50333f07a0..c4cf520db5 100644
--- a/packages/core-app-api/src/apis/implementations/auth/index.ts
+++ b/packages/core-app-api/src/apis/implementations/auth/index.ts
@@ -20,7 +20,6 @@ export * from './google';
export * from './oauth2';
export * from './okta';
export * from './saml';
-export * from './auth0';
export * from './microsoft';
export * from './onelogin';
export * from './bitbucket';
diff --git a/packages/core-components/src/layout/SignInPage/auth0Provider.tsx b/packages/core-components/src/layout/SignInPage/auth0Provider.tsx
deleted file mode 100644
index 739c3709a9..0000000000
--- a/packages/core-components/src/layout/SignInPage/auth0Provider.tsx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2020 The Backstage Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React from 'react';
-import Grid from '@material-ui/core/Grid';
-import Typography from '@material-ui/core/Typography';
-import Button from '@material-ui/core/Button';
-import { InfoCard } from '../InfoCard/InfoCard';
-import { ProviderComponent, ProviderLoader, SignInProvider } from './types';
-import {
- useApi,
- auth0AuthApiRef,
- errorApiRef,
-} from '@backstage/core-plugin-api';
-import { ForwardedError } from '@backstage/errors';
-import { UserIdentity } from './UserIdentity';
-
-const Component: ProviderComponent = ({ onSignInSuccess }) => {
- const auth0AuthApi = useApi(auth0AuthApiRef);
- const errorApi = useApi(errorApiRef);
-
- const handleLogin = async () => {
- try {
- const identityResponse = await auth0AuthApi.getBackstageIdentity({
- instantPopup: true,
- });
- if (!identityResponse) {
- throw new Error(
- 'The Auth0 provider is not configured to support sign-in',
- );
- }
-
- const profile = await auth0AuthApi.getProfile();
-
- onSignInSuccess(
- UserIdentity.create({
- identity: identityResponse.identity,
- authApi: auth0AuthApi,
- profile,
- }),
- );
- } catch (error) {
- errorApi.post(new ForwardedError('Auth0 login failed', error));
- }
- };
-
- return (
-
(
data: unknown,
): void;
-// @public @deprecated
-export const auth0AuthApiRef: ApiRef<
- OpenIdConnectApi & ProfileInfoApi & BackstageIdentityApi & SessionApi
->;
-
// @public
export type AuthProviderInfo = {
id: string;
@@ -531,15 +526,6 @@ export const microsoftAuthApiRef: ApiRef<
SessionApi
>;
-// @public @deprecated
-export const oauth2ApiRef: ApiRef<
- OAuthApi &
- OpenIdConnectApi &
- ProfileInfoApi &
- BackstageIdentityApi &
- SessionApi
->;
-
// @public
export type OAuthApi = {
getAccessToken(
@@ -573,15 +559,6 @@ export type OAuthRequesterOptions