From c11ce4f55256c10cf12053501645775b7c28184b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 13 Dec 2021 11:50:16 +0100 Subject: [PATCH] core-app-api: deprecated Auth0Auth Co-authored-by: Johan Haals Signed-off-by: Patrik Oldsberg --- .changeset/beige-news-cover.md | 5 +++++ packages/core-app-api/api-report.md | 2 +- .../implementations/auth/auth0/Auth0Auth.ts | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .changeset/beige-news-cover.md diff --git a/.changeset/beige-news-cover.md b/.changeset/beige-news-cover.md new file mode 100644 index 0000000000..70cebcd76f --- /dev/null +++ b/.changeset/beige-news-cover.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-app-api': patch +--- + +Deprecated `Auth0Auth`, pointing to using `OAuth2` directly instead. diff --git a/packages/core-app-api/api-report.md b/packages/core-app-api/api-report.md index 51fd6bd06f..788dc4c6c3 100644 --- a/packages/core-app-api/api-report.md +++ b/packages/core-app-api/api-report.md @@ -254,7 +254,7 @@ export class AtlassianAuth { static create(options: OAuthApiCreateOptions): typeof atlassianAuthApiRef.T; } -// @public +// @public @deprecated export class Auth0Auth { // (undocumented) static create(options: OAuthApiCreateOptions): typeof auth0AuthApiRef.T; 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 index d0a9dc5d99..d8f942b94b 100644 --- a/packages/core-app-api/src/apis/implementations/auth/auth0/Auth0Auth.ts +++ b/packages/core-app-api/src/apis/implementations/auth/auth0/Auth0Auth.ts @@ -28,6 +28,23 @@ const DEFAULT_PROVIDER = { * 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 {