@red-hat-developer-hub/backstage-plugin-app-auth 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # @red-hat-developer-hub/backstage-plugin-app-auth
2
+
3
+ RHDH sign-in page (multi-provider) and OIDC / Auth0 / SAML frontend OAuth2 APIs for the **new frontend system**, registered against `pluginId: 'app'`.
4
+
5
+ ## Usage
6
+
7
+ - **Dynamic loading**: default export is a `FrontendModule` suitable for `@backstage/frontend-dynamic-feature-loader`.
8
+ - **Static / alpha**: import from `@red-hat-developer-hub/backstage-plugin-app-auth/alpha` for `appAuthModule`, `SignInPage`, `signInTranslationRef`, and auth API refs.
9
+
10
+ ## Config
11
+
12
+ Root `signInPage` (string or string[]) selects which providers appear; see `config.d.ts`.
package/config.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright Red Hat, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export interface Config {
18
+ /**
19
+ * Sign-in provider id(s) to show on the RHDH sign-in page.
20
+ * @visibility frontend
21
+ */
22
+ signInPage?: string | string[];
23
+ }
@@ -0,0 +1,14 @@
1
+ import { createApiRef } from '@backstage/core-plugin-api';
2
+
3
+ const oidcAuthApiRef = createApiRef({
4
+ id: "internal.auth.oidc"
5
+ });
6
+ const auth0AuthApiRef = createApiRef({
7
+ id: "internal.auth.auth0"
8
+ });
9
+ const samlAuthApiRef = createApiRef({
10
+ id: "internal.auth.saml"
11
+ });
12
+
13
+ export { auth0AuthApiRef, oidcAuthApiRef, samlAuthApiRef };
14
+ //# sourceMappingURL=AuthApiRefs.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthApiRefs.esm.js","sources":["../src/AuthApiRefs.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createApiRef,\n type ApiRef,\n type BackstageIdentityApi,\n type OAuthApi,\n type OpenIdConnectApi,\n type ProfileInfoApi,\n type SessionApi,\n} from '@backstage/core-plugin-api';\n\n/**\n * Combined surface for custom RHDH auth APIs backed by `OAuth2` in the app module.\n *\n * @alpha\n */\nexport type CustomAuthApiRefType = OAuthApi &\n OpenIdConnectApi &\n ProfileInfoApi &\n BackstageIdentityApi &\n SessionApi;\n\n/**\n * OIDC auth API for the RHDH multi-provider sign-in page.\n *\n * @alpha\n */\nexport const oidcAuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.oidc',\n});\n\n/**\n * Auth0 auth API for the RHDH multi-provider sign-in page.\n *\n * @alpha\n */\nexport const auth0AuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.auth0',\n});\n\n/**\n * SAML auth API for the RHDH multi-provider sign-in page.\n *\n * @alpha\n */\nexport const samlAuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.saml',\n});\n"],"names":[],"mappings":";;AA0CO,MAAM,iBAA+C,YAAA,CAAa;AAAA,EACvE,EAAA,EAAI;AACN,CAAC;AAOM,MAAM,kBAAgD,YAAA,CAAa;AAAA,EACxE,EAAA,EAAI;AACN,CAAC;AAOM,MAAM,iBAA+C,YAAA,CAAa;AAAA,EACvE,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,81 @@
1
+ import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
+ import { SignInPageProps, OAuthApi, OpenIdConnectApi, ProfileInfoApi, BackstageIdentityApi, SessionApi, ApiRef } from '@backstage/core-plugin-api';
3
+
4
+ /**
5
+ * RHDH app sign-in page plus OIDC, Auth0, and SAML OAuth2 frontend APIs (`pluginId: app`).
6
+ * Default-export this module for dynamic frontend loading.
7
+ *
8
+ * @alpha
9
+ */
10
+ declare const appAuthModule: _backstage_frontend_plugin_api.FrontendModule;
11
+
12
+ /**
13
+ * RHDH multi-provider sign-in page (mirrors classic app `SignInPage` behavior for NFS).
14
+ *
15
+ * @alpha
16
+ */
17
+ declare function SignInPage(props: SignInPageProps): React.JSX.Element;
18
+
19
+ /**
20
+ * Combined surface for custom RHDH auth APIs backed by `OAuth2` in the app module.
21
+ *
22
+ * @alpha
23
+ */
24
+ type CustomAuthApiRefType = OAuthApi & OpenIdConnectApi & ProfileInfoApi & BackstageIdentityApi & SessionApi;
25
+ /**
26
+ * OIDC auth API for the RHDH multi-provider sign-in page.
27
+ *
28
+ * @alpha
29
+ */
30
+ declare const oidcAuthApiRef: ApiRef<CustomAuthApiRefType>;
31
+ /**
32
+ * Auth0 auth API for the RHDH multi-provider sign-in page.
33
+ *
34
+ * @alpha
35
+ */
36
+ declare const auth0AuthApiRef: ApiRef<CustomAuthApiRefType>;
37
+ /**
38
+ * SAML auth API for the RHDH multi-provider sign-in page.
39
+ *
40
+ * @alpha
41
+ */
42
+ declare const samlAuthApiRef: ApiRef<CustomAuthApiRefType>;
43
+
44
+ /**
45
+ * Sign-in page messages (English). Same key shape as legacy RHDH app signIn for compatibility.
46
+ *
47
+ * @alpha
48
+ */
49
+ declare const signInTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"plugin.app-auth.sign-in", {
50
+ readonly "signIn.page.title": "Select a sign-in method";
51
+ readonly "signIn.config.missingAuthEnvironment.error": "Missing required app configuration: auth.environment must be set";
52
+ readonly "signIn.config.missingAuthEnvironment.panelTitle": "Sign-in is not available";
53
+ readonly "signIn.config.missingAuthEnvironment.description": "Set {{ authEnvKey }} in your app configuration (for example {{ devEnv }} for local use or {{ prodEnv }} in deployed environments). Without it, the app cannot safely determine which sign-in options to offer.";
54
+ readonly "signIn.providers.auth0.title": "Auth0";
55
+ readonly "signIn.providers.auth0.message": "Sign in using Auth0";
56
+ readonly "signIn.providers.atlassian.title": "Atlassian";
57
+ readonly "signIn.providers.atlassian.message": "Sign in using Atlassian";
58
+ readonly "signIn.providers.microsoft.title": "Microsoft";
59
+ readonly "signIn.providers.microsoft.message": "Sign in using Microsoft";
60
+ readonly "signIn.providers.bitbucket.title": "Bitbucket";
61
+ readonly "signIn.providers.bitbucket.message": "Sign in using Bitbucket";
62
+ readonly "signIn.providers.bitbucketServer.title": "Bitbucket Server";
63
+ readonly "signIn.providers.bitbucketServer.message": "Sign in using Bitbucket Server";
64
+ readonly "signIn.providers.github.title": "GitHub";
65
+ readonly "signIn.providers.github.message": "Sign in using GitHub";
66
+ readonly "signIn.providers.gitlab.title": "GitLab";
67
+ readonly "signIn.providers.gitlab.message": "Sign in using GitLab";
68
+ readonly "signIn.providers.google.title": "Google";
69
+ readonly "signIn.providers.google.message": "Sign in using Google";
70
+ readonly "signIn.providers.oidc.title": "OIDC";
71
+ readonly "signIn.providers.oidc.message": "Sign in using OIDC";
72
+ readonly "signIn.providers.okta.title": "Okta";
73
+ readonly "signIn.providers.okta.message": "Sign in using Okta";
74
+ readonly "signIn.providers.onelogin.title": "OneLogin";
75
+ readonly "signIn.providers.onelogin.message": "Sign in using OneLogin";
76
+ readonly "signIn.providers.saml.title": "SAML";
77
+ readonly "signIn.providers.saml.message": "Sign in using SAML";
78
+ }>;
79
+
80
+ export { SignInPage, appAuthModule, auth0AuthApiRef, appAuthModule as default, oidcAuthApiRef, samlAuthApiRef, signInTranslationRef };
81
+ export type { CustomAuthApiRefType };
@@ -0,0 +1,5 @@
1
+ export { appAuthModule, appAuthModule as default } from './appAuthModule.esm.js';
2
+ export { SignInPage } from './components/SignInPage.esm.js';
3
+ export { auth0AuthApiRef, oidcAuthApiRef, samlAuthApiRef } from './AuthApiRefs.esm.js';
4
+ export { signInTranslationRef } from './translations/signIn.esm.js';
5
+ //# sourceMappingURL=alpha.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,85 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { OAuth2 } from '@backstage/core-app-api';
3
+ import { configApiRef, oauthRequestApiRef, discoveryApiRef } from '@backstage/core-plugin-api';
4
+ import { ApiBlueprint, createFrontendModule } from '@backstage/frontend-plugin-api';
5
+ import appPlugin from '@backstage/plugin-app';
6
+ import { oidcAuthApiRef, auth0AuthApiRef, samlAuthApiRef } from './AuthApiRefs.esm.js';
7
+ import { SignInPage } from './components/SignInPage.esm.js';
8
+
9
+ const oidcAuthApi = ApiBlueprint.make({
10
+ name: "oidc-auth",
11
+ params: (defineParams) => defineParams({
12
+ api: oidcAuthApiRef,
13
+ deps: {
14
+ discoveryApi: discoveryApiRef,
15
+ oauthRequestApi: oauthRequestApiRef,
16
+ configApi: configApiRef
17
+ },
18
+ factory: ({ discoveryApi, oauthRequestApi, configApi }) => OAuth2.create({
19
+ configApi,
20
+ discoveryApi,
21
+ oauthRequestApi,
22
+ provider: {
23
+ id: "oidc",
24
+ title: "OIDC",
25
+ icon: () => null
26
+ },
27
+ environment: configApi.getOptionalString("auth.environment")
28
+ })
29
+ })
30
+ });
31
+ const auth0AuthApi = ApiBlueprint.make({
32
+ name: "auth0-auth",
33
+ params: (defineParams) => defineParams({
34
+ api: auth0AuthApiRef,
35
+ deps: {
36
+ discoveryApi: discoveryApiRef,
37
+ oauthRequestApi: oauthRequestApiRef,
38
+ configApi: configApiRef
39
+ },
40
+ factory: ({ discoveryApi, oauthRequestApi, configApi }) => OAuth2.create({
41
+ discoveryApi,
42
+ oauthRequestApi,
43
+ provider: {
44
+ id: "auth0",
45
+ title: "Auth0",
46
+ icon: () => null
47
+ },
48
+ defaultScopes: ["openid", "email", "profile"],
49
+ environment: configApi.getOptionalString("auth.environment")
50
+ })
51
+ })
52
+ });
53
+ const samlAuthApi = ApiBlueprint.make({
54
+ name: "saml-auth",
55
+ params: (defineParams) => defineParams({
56
+ api: samlAuthApiRef,
57
+ deps: {
58
+ discoveryApi: discoveryApiRef,
59
+ oauthRequestApi: oauthRequestApiRef,
60
+ configApi: configApiRef
61
+ },
62
+ factory: ({ discoveryApi, oauthRequestApi, configApi }) => OAuth2.create({
63
+ discoveryApi,
64
+ oauthRequestApi,
65
+ provider: {
66
+ id: "saml",
67
+ title: "SAML",
68
+ icon: () => null
69
+ },
70
+ environment: configApi.getOptionalString("auth.environment")
71
+ })
72
+ })
73
+ });
74
+ const signInPageOverride = appPlugin.getExtension("sign-in-page:app").override({
75
+ params: {
76
+ loader: async () => (props) => /* @__PURE__ */ jsx(SignInPage, { ...props })
77
+ }
78
+ });
79
+ const appAuthModule = createFrontendModule({
80
+ pluginId: "app",
81
+ extensions: [signInPageOverride, oidcAuthApi, auth0AuthApi, samlAuthApi]
82
+ });
83
+
84
+ export { appAuthModule };
85
+ //# sourceMappingURL=appAuthModule.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appAuthModule.esm.js","sources":["../src/appAuthModule.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OAuth2 } from '@backstage/core-app-api';\nimport {\n configApiRef,\n discoveryApiRef,\n oauthRequestApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n ApiBlueprint,\n createFrontendModule,\n} from '@backstage/frontend-plugin-api';\nimport appPlugin from '@backstage/plugin-app';\n\nimport { auth0AuthApiRef, oidcAuthApiRef, samlAuthApiRef } from './AuthApiRefs';\nimport { SignInPage } from './components/SignInPage';\n\nconst oidcAuthApi = ApiBlueprint.make({\n name: 'oidc-auth',\n params: defineParams =>\n defineParams({\n api: oidcAuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n configApi,\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'oidc',\n title: 'OIDC',\n icon: () => null,\n },\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst auth0AuthApi = ApiBlueprint.make({\n name: 'auth0-auth',\n params: defineParams =>\n defineParams({\n api: auth0AuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'auth0',\n title: 'Auth0',\n icon: () => null,\n },\n defaultScopes: ['openid', 'email', 'profile'],\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst samlAuthApi = ApiBlueprint.make({\n name: 'saml-auth',\n params: defineParams =>\n defineParams({\n api: samlAuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'saml',\n title: 'SAML',\n icon: () => null,\n },\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst signInPageOverride = appPlugin.getExtension('sign-in-page:app').override({\n params: {\n loader: async () => (props: Parameters<typeof SignInPage>[0]) =>\n <SignInPage {...props} />,\n },\n});\n\n/**\n * RHDH app sign-in page plus OIDC, Auth0, and SAML OAuth2 frontend APIs (`pluginId: app`).\n * Default-export this module for dynamic frontend loading.\n *\n * @alpha\n */\nexport const appAuthModule = createFrontendModule({\n pluginId: 'app',\n extensions: [signInPageOverride, oidcAuthApi, auth0AuthApi, samlAuthApi],\n});\n"],"names":[],"mappings":";;;;;;;;AA+BA,MAAM,WAAA,GAAc,aAAa,IAAA,CAAK;AAAA,EACpC,IAAA,EAAM,WAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,cAAA;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,YAAA,EAAc,eAAA;AAAA,MACd,eAAA,EAAiB,kBAAA;AAAA,MACjB,SAAA,EAAW;AAAA,KACb;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,iBAAiB,SAAA,EAAU,KACnD,OAAO,MAAA,CAAO;AAAA,MACZ,SAAA;AAAA,MACA,YAAA;AAAA,MACA,eAAA;AAAA,MACA,QAAA,EAAU;AAAA,QACR,EAAA,EAAI,MAAA;AAAA,QACJ,KAAA,EAAO,MAAA;AAAA,QACP,MAAM,MAAM;AAAA,OACd;AAAA,MACA,WAAA,EAAa,SAAA,CAAU,iBAAA,CAAkB,kBAAkB;AAAA,KAC5D;AAAA,GACJ;AACL,CAAC,CAAA;AAED,MAAM,YAAA,GAAe,aAAa,IAAA,CAAK;AAAA,EACrC,IAAA,EAAM,YAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,eAAA;AAAA,IACL,IAAA,EAAM;A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,CAAC,0BACnB,GAAA,CAAC,UAAA,EAAA,EAAY,GAAG,KAAA,EAAO;AAAA;AAE7B,CAAC,CAAA;AAQM,MAAM,gBAAgB,oBAAA,CAAqB;AAAA,EAChD,QAAA,EAAU,KAAA;AAAA,EACV,UAAA,EAAY,CAAC,kBAAA,EAAoB,WAAA,EAAa,cAAc,WAAW;AACzE,CAAC;;;;"}
@@ -0,0 +1,177 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { ErrorPanel, ProxiedSignInPage, SignInPage as SignInPage$1 } from '@backstage/core-components';
3
+ import { useApi, configApiRef, atlassianAuthApiRef, microsoftAuthApiRef, bitbucketAuthApiRef, bitbucketServerAuthApiRef, githubAuthApiRef, gitlabAuthApiRef, googleAuthApiRef, oktaAuthApiRef, oneloginAuthApiRef } from '@backstage/core-plugin-api';
4
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
5
+ import Typography from '@mui/material/Typography';
6
+ import { auth0AuthApiRef, oidcAuthApiRef, samlAuthApiRef } from '../AuthApiRefs.esm.js';
7
+ import { signInTranslationRef } from '../translations/signIn.esm.js';
8
+
9
+ const DEFAULT_PROVIDER = "github";
10
+ const createProviders = (t) => /* @__PURE__ */ new Map([
11
+ [
12
+ "auth0",
13
+ {
14
+ id: "auth0-auth-provider",
15
+ title: t("signIn.providers.auth0.title"),
16
+ message: t("signIn.providers.auth0.message"),
17
+ apiRef: auth0AuthApiRef
18
+ }
19
+ ],
20
+ [
21
+ "atlassian",
22
+ {
23
+ id: "atlassian-auth-provider",
24
+ title: t("signIn.providers.atlassian.title"),
25
+ message: t("signIn.providers.atlassian.message"),
26
+ apiRef: atlassianAuthApiRef
27
+ }
28
+ ],
29
+ [
30
+ "microsoft",
31
+ {
32
+ id: "microsoft-auth-provider",
33
+ title: t("signIn.providers.microsoft.title"),
34
+ message: t("signIn.providers.microsoft.message"),
35
+ apiRef: microsoftAuthApiRef
36
+ }
37
+ ],
38
+ ["azure-easyauth", "azure-easyauth"],
39
+ [
40
+ "bitbucket",
41
+ {
42
+ id: "bitbucket-auth-provider",
43
+ title: t("signIn.providers.bitbucket.title"),
44
+ message: t("signIn.providers.bitbucket.message"),
45
+ apiRef: bitbucketAuthApiRef
46
+ }
47
+ ],
48
+ [
49
+ "bitbucketServer",
50
+ {
51
+ id: "bitbucket-server-auth-provider",
52
+ title: t("signIn.providers.bitbucketServer.title"),
53
+ message: t("signIn.providers.bitbucketServer.message"),
54
+ apiRef: bitbucketServerAuthApiRef
55
+ }
56
+ ],
57
+ ["cfaccess", "cfaccess"],
58
+ [
59
+ "github",
60
+ {
61
+ id: "github-auth-provider",
62
+ title: t("signIn.providers.github.title"),
63
+ message: t("signIn.providers.github.message"),
64
+ apiRef: githubAuthApiRef
65
+ }
66
+ ],
67
+ [
68
+ "gitlab",
69
+ {
70
+ id: "gitlab-auth-provider",
71
+ title: t("signIn.providers.gitlab.title"),
72
+ message: t("signIn.providers.gitlab.message"),
73
+ apiRef: gitlabAuthApiRef
74
+ }
75
+ ],
76
+ [
77
+ "google",
78
+ {
79
+ id: "google-auth-provider",
80
+ title: t("signIn.providers.google.title"),
81
+ message: t("signIn.providers.google.message"),
82
+ apiRef: googleAuthApiRef
83
+ }
84
+ ],
85
+ ["gcp-iap", "gcp-iap"],
86
+ [
87
+ "oidc",
88
+ {
89
+ id: "oidc-auth-provider",
90
+ title: t("signIn.providers.oidc.title"),
91
+ message: t("signIn.providers.oidc.message"),
92
+ apiRef: oidcAuthApiRef
93
+ }
94
+ ],
95
+ [
96
+ "okta",
97
+ {
98
+ id: "okta-auth-provider",
99
+ title: t("signIn.providers.okta.title"),
100
+ message: t("signIn.providers.okta.message"),
101
+ apiRef: oktaAuthApiRef
102
+ }
103
+ ],
104
+ ["oauth2Proxy", "oauth2Proxy"],
105
+ [
106
+ "onelogin",
107
+ {
108
+ id: "onelogin-auth-provider",
109
+ title: t("signIn.providers.onelogin.title"),
110
+ message: t("signIn.providers.onelogin.message"),
111
+ apiRef: oneloginAuthApiRef
112
+ }
113
+ ],
114
+ [
115
+ "saml",
116
+ {
117
+ id: "saml-auth-provider",
118
+ title: t("signIn.providers.saml.title"),
119
+ message: t("signIn.providers.saml.message"),
120
+ apiRef: samlAuthApiRef
121
+ }
122
+ ]
123
+ ]);
124
+ function SignInPage(props) {
125
+ const configApi = useApi(configApiRef);
126
+ const { t } = useTranslationRef(signInTranslationRef);
127
+ const authEnvironment = configApi.getOptionalString("auth.environment");
128
+ if (!authEnvironment?.trim()) {
129
+ return /* @__PURE__ */ jsx(
130
+ ErrorPanel,
131
+ {
132
+ error: new Error(t("signIn.config.missingAuthEnvironment.error")),
133
+ title: t("signIn.config.missingAuthEnvironment.panelTitle"),
134
+ children: /* @__PURE__ */ jsx(Typography, { variant: "body2", component: "div", children: t("signIn.config.missingAuthEnvironment.description", {
135
+ replace: {
136
+ authEnvKey: /* @__PURE__ */ jsx("code", { children: "auth.environment" }),
137
+ devEnv: /* @__PURE__ */ jsx("code", { children: "development" }),
138
+ prodEnv: /* @__PURE__ */ jsx("code", { children: "production" })
139
+ }
140
+ }) })
141
+ }
142
+ );
143
+ }
144
+ const isDevEnv = authEnvironment === "development";
145
+ const signInPageConfig = configApi.getOptional(
146
+ "signInPage"
147
+ );
148
+ const configValue = signInPageConfig ?? DEFAULT_PROVIDER;
149
+ const providerNames = Array.isArray(configValue) ? configValue : [configValue];
150
+ const providers = createProviders(t);
151
+ const providerConfigs = providerNames.map((name) => providers.get(name)).filter(
152
+ (config) => config !== void 0
153
+ );
154
+ if (providerConfigs.length === 0) {
155
+ const defaultProvider = providers.get(DEFAULT_PROVIDER);
156
+ if (defaultProvider) providerConfigs.push(defaultProvider);
157
+ }
158
+ if (providerConfigs.some((config) => typeof config === "string")) {
159
+ const proxiedProvider = providerConfigs.find(
160
+ (config) => typeof config === "string"
161
+ );
162
+ return /* @__PURE__ */ jsx(ProxiedSignInPage, { ...props, provider: proxiedProvider });
163
+ }
164
+ const providerList = isDevEnv ? ["guest", ...providerConfigs] : providerConfigs;
165
+ return /* @__PURE__ */ jsx(
166
+ SignInPage$1,
167
+ {
168
+ ...props,
169
+ title: t("signIn.page.title"),
170
+ align: "center",
171
+ providers: providerList
172
+ }
173
+ );
174
+ }
175
+
176
+ export { SignInPage };
177
+ //# sourceMappingURL=SignInPage.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignInPage.esm.js","sources":["../../src/components/SignInPage.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ErrorPanel,\n SignInPage as CCSignInPage,\n ProxiedSignInPage,\n type SignInProviderConfig,\n} from '@backstage/core-components';\nimport {\n atlassianAuthApiRef,\n bitbucketAuthApiRef,\n bitbucketServerAuthApiRef,\n configApiRef,\n githubAuthApiRef,\n gitlabAuthApiRef,\n googleAuthApiRef,\n microsoftAuthApiRef,\n oktaAuthApiRef,\n oneloginAuthApiRef,\n useApi,\n type SignInPageProps,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport Typography from '@mui/material/Typography';\n\nimport {\n auth0AuthApiRef,\n oidcAuthApiRef,\n samlAuthApiRef,\n} from '../AuthApiRefs';\nimport { signInTranslationRef } from '../translations/signIn';\n\nconst DEFAULT_PROVIDER = 'github';\n\nconst createProviders = (t: (key: string, params?: any) => string) =>\n new Map<string, SignInProviderConfig | string>([\n [\n 'auth0',\n {\n id: 'auth0-auth-provider',\n title: t('signIn.providers.auth0.title'),\n message: t('signIn.providers.auth0.message'),\n apiRef: auth0AuthApiRef,\n },\n ],\n [\n 'atlassian',\n {\n id: 'atlassian-auth-provider',\n title: t('signIn.providers.atlassian.title'),\n message: t('signIn.providers.atlassian.message'),\n apiRef: atlassianAuthApiRef,\n },\n ],\n [\n 'microsoft',\n {\n id: 'microsoft-auth-provider',\n title: t('signIn.providers.microsoft.title'),\n message: t('signIn.providers.microsoft.message'),\n apiRef: microsoftAuthApiRef,\n },\n ],\n ['azure-easyauth', 'azure-easyauth'],\n [\n 'bitbucket',\n {\n id: 'bitbucket-auth-provider',\n title: t('signIn.providers.bitbucket.title'),\n message: t('signIn.providers.bitbucket.message'),\n apiRef: bitbucketAuthApiRef,\n },\n ],\n [\n 'bitbucketServer',\n {\n id: 'bitbucket-server-auth-provider',\n title: t('signIn.providers.bitbucketServer.title'),\n message: t('signIn.providers.bitbucketServer.message'),\n apiRef: bitbucketServerAuthApiRef,\n },\n ],\n ['cfaccess', 'cfaccess'],\n [\n 'github',\n {\n id: 'github-auth-provider',\n title: t('signIn.providers.github.title'),\n message: t('signIn.providers.github.message'),\n apiRef: githubAuthApiRef,\n },\n ],\n [\n 'gitlab',\n {\n id: 'gitlab-auth-provider',\n title: t('signIn.providers.gitlab.title'),\n message: t('signIn.providers.gitlab.message'),\n apiRef: gitlabAuthApiRef,\n },\n ],\n [\n 'google',\n {\n id: 'google-auth-provider',\n title: t('signIn.providers.google.title'),\n message: t('signIn.providers.google.message'),\n apiRef: googleAuthApiRef,\n },\n ],\n ['gcp-iap', 'gcp-iap'],\n [\n 'oidc',\n {\n id: 'oidc-auth-provider',\n title: t('signIn.providers.oidc.title'),\n message: t('signIn.providers.oidc.message'),\n apiRef: oidcAuthApiRef,\n },\n ],\n [\n 'okta',\n {\n id: 'okta-auth-provider',\n title: t('signIn.providers.okta.title'),\n message: t('signIn.providers.okta.message'),\n apiRef: oktaAuthApiRef,\n },\n ],\n ['oauth2Proxy', 'oauth2Proxy'],\n [\n 'onelogin',\n {\n id: 'onelogin-auth-provider',\n title: t('signIn.providers.onelogin.title'),\n message: t('signIn.providers.onelogin.message'),\n apiRef: oneloginAuthApiRef,\n },\n ],\n [\n 'saml',\n {\n id: 'saml-auth-provider',\n title: t('signIn.providers.saml.title'),\n message: t('signIn.providers.saml.message'),\n apiRef: samlAuthApiRef,\n },\n ],\n ]);\n\n/**\n * RHDH multi-provider sign-in page (mirrors classic app `SignInPage` behavior for NFS).\n *\n * @alpha\n */\nexport function SignInPage(props: SignInPageProps): React.JSX.Element {\n const configApi = useApi(configApiRef);\n const { t } = useTranslationRef(signInTranslationRef);\n const authEnvironment = configApi.getOptionalString('auth.environment');\n if (!authEnvironment?.trim()) {\n return (\n <ErrorPanel\n error={new Error(t('signIn.config.missingAuthEnvironment.error'))}\n title={t('signIn.config.missingAuthEnvironment.panelTitle')}\n >\n <Typography variant=\"body2\" component=\"div\">\n {t('signIn.config.missingAuthEnvironment.description', {\n replace: {\n authEnvKey: <code>auth.environment</code>,\n devEnv: <code>development</code>,\n prodEnv: <code>production</code>,\n },\n })}\n </Typography>\n </ErrorPanel>\n );\n }\n const isDevEnv = authEnvironment === 'development';\n\n const signInPageConfig = configApi.getOptional<string | string[]>(\n 'signInPage',\n );\n const configValue = signInPageConfig ?? DEFAULT_PROVIDER;\n const providerNames = Array.isArray(configValue)\n ? configValue\n : [configValue];\n\n const providers = createProviders(t);\n\n const providerConfigs = providerNames\n .map(name => providers.get(name))\n .filter(\n (config): config is SignInProviderConfig | string => config !== undefined,\n );\n\n if (providerConfigs.length === 0) {\n const defaultProvider = providers.get(DEFAULT_PROVIDER);\n if (defaultProvider) providerConfigs.push(defaultProvider);\n }\n\n if (providerConfigs.some(config => typeof config === 'string')) {\n const proxiedProvider = providerConfigs.find(\n config => typeof config === 'string',\n ) as string;\n return <ProxiedSignInPage {...props} provider={proxiedProvider} />;\n }\n\n const providerList = isDevEnv\n ? ['guest' as const, ...(providerConfigs as SignInProviderConfig[])]\n : (providerConfigs as SignInProviderConfig[]);\n\n return (\n <CCSignInPage\n {...props}\n title={t('signIn.page.title')}\n align=\"center\"\n providers={providerList}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bundlers. This plugin targets
3
+ * the new frontend system only; use `./alpha` for public APIs.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ declare const _default: {};
8
+
9
+ export { _default as default };
@@ -0,0 +1,4 @@
1
+ var index = {};
2
+
3
+ export { index as default };
4
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Stub package root export for API reporting and bundlers. This plugin targets\n * the new frontend system only; use `./alpha` for public APIs.\n *\n * @packageDocumentation\n */\nexport default {};\n"],"names":[],"mappings":"AAsBA,YAAe,EAAC;;;;"}
@@ -0,0 +1,72 @@
1
+ import { createTranslationRef } from '@backstage/core-plugin-api/alpha';
2
+
3
+ const signInTranslationRef = createTranslationRef({
4
+ id: "plugin.app-auth.sign-in",
5
+ messages: {
6
+ signIn: {
7
+ page: {
8
+ title: "Select a sign-in method"
9
+ },
10
+ config: {
11
+ missingAuthEnvironment: {
12
+ error: "Missing required app configuration: auth.environment must be set",
13
+ panelTitle: "Sign-in is not available",
14
+ description: "Set {{ authEnvKey }} in your app configuration (for example {{ devEnv }} for local use or {{ prodEnv }} in deployed environments). Without it, the app cannot safely determine which sign-in options to offer."
15
+ }
16
+ },
17
+ providers: {
18
+ auth0: {
19
+ title: "Auth0",
20
+ message: "Sign in using Auth0"
21
+ },
22
+ atlassian: {
23
+ title: "Atlassian",
24
+ message: "Sign in using Atlassian"
25
+ },
26
+ microsoft: {
27
+ title: "Microsoft",
28
+ message: "Sign in using Microsoft"
29
+ },
30
+ bitbucket: {
31
+ title: "Bitbucket",
32
+ message: "Sign in using Bitbucket"
33
+ },
34
+ bitbucketServer: {
35
+ title: "Bitbucket Server",
36
+ message: "Sign in using Bitbucket Server"
37
+ },
38
+ github: {
39
+ title: "GitHub",
40
+ message: "Sign in using GitHub"
41
+ },
42
+ gitlab: {
43
+ title: "GitLab",
44
+ message: "Sign in using GitLab"
45
+ },
46
+ google: {
47
+ title: "Google",
48
+ message: "Sign in using Google"
49
+ },
50
+ oidc: {
51
+ title: "OIDC",
52
+ message: "Sign in using OIDC"
53
+ },
54
+ okta: {
55
+ title: "Okta",
56
+ message: "Sign in using Okta"
57
+ },
58
+ onelogin: {
59
+ title: "OneLogin",
60
+ message: "Sign in using OneLogin"
61
+ },
62
+ saml: {
63
+ title: "SAML",
64
+ message: "Sign in using SAML"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ });
70
+
71
+ export { signInTranslationRef };
72
+ //# sourceMappingURL=signIn.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signIn.esm.js","sources":["../../src/translations/signIn.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/**\n * Sign-in page messages (English). Same key shape as legacy RHDH app signIn for compatibility.\n *\n * @alpha\n */\nexport const signInTranslationRef = createTranslationRef({\n id: 'plugin.app-auth.sign-in',\n messages: {\n signIn: {\n page: {\n title: 'Select a sign-in method',\n },\n config: {\n missingAuthEnvironment: {\n error:\n 'Missing required app configuration: auth.environment must be set',\n panelTitle: 'Sign-in is not available',\n description:\n 'Set {{ authEnvKey }} in your app configuration (for example {{ devEnv }} for local use or {{ prodEnv }} in deployed environments). Without it, the app cannot safely determine which sign-in options to offer.',\n },\n },\n providers: {\n auth0: {\n title: 'Auth0',\n message: 'Sign in using Auth0',\n },\n atlassian: {\n title: 'Atlassian',\n message: 'Sign in using Atlassian',\n },\n microsoft: {\n title: 'Microsoft',\n message: 'Sign in using Microsoft',\n },\n bitbucket: {\n title: 'Bitbucket',\n message: 'Sign in using Bitbucket',\n },\n bitbucketServer: {\n title: 'Bitbucket Server',\n message: 'Sign in using Bitbucket Server',\n },\n github: {\n title: 'GitHub',\n message: 'Sign in using GitHub',\n },\n gitlab: {\n title: 'GitLab',\n message: 'Sign in using GitLab',\n },\n google: {\n title: 'Google',\n message: 'Sign in using Google',\n },\n oidc: {\n title: 'OIDC',\n message: 'Sign in using OIDC',\n },\n okta: {\n title: 'Okta',\n message: 'Sign in using Okta',\n },\n onelogin: {\n title: 'OneLogin',\n message: 'Sign in using OneLogin',\n },\n saml: {\n title: 'SAML',\n message: 'Sign in using SAML',\n },\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAuBO,MAAM,uBAAuB,oBAAA,CAAqB;AAAA,EACvD,EAAA,EAAI,yBAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM;AAAA,QACJ,KAAA,EAAO;AAAA,OACT;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,sBAAA,EAAwB;AAAA,UACtB,KAAA,EACE,kEAAA;AAAA,UACF,UAAA,EAAY,0BAAA;AAAA,UACZ,WAAA,EACE;AAAA;AACJ,OACF;AAAA,MACA,SAAA,EAAW;AAAA,QACT,KAAA,EAAO;AAAA,UACL,KAAA,EAAO,OAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,SAAA,EAAW;AAAA,UACT,KAAA,EAAO,WAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,SAAA,EAAW;AAAA,UACT,KAAA,EAAO,WAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,SAAA,EAAW;AAAA,UACT,KAAA,EAAO,WAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,eAAA,EAAiB;AAAA,UACf,KAAA,EAAO,kBAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,MAAA,EAAQ;AAAA,UACN,KAAA,EAAO,QAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,MAAA,EAAQ;AAAA,UACN,KAAA,EAAO,QAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,MAAA,EAAQ;AAAA,UACN,KAAA,EAAO,QAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,IAAA,EAAM;AAAA,UACJ,KAAA,EAAO,MAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,IAAA,EAAM;AAAA,UACJ,KAAA,EAAO,MAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,QAAA,EAAU;AAAA,UACR,KAAA,EAAO,UAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QACA,IAAA,EAAM;AAAA,UACJ,KAAA,EAAO,MAAA;AAAA,UACP,OAAA,EAAS;AAAA;AACX;AACF;AACF;AAEJ,CAAC;;;;"}
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "@red-hat-developer-hub/backstage-plugin-app-auth",
3
+ "version": "0.0.0",
4
+ "license": "Apache-2.0",
5
+ "description": "RHDH sign-in page and OIDC/Auth0/SAML frontend auth APIs for the new frontend system",
6
+ "main": "./dist/index.esm.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.esm.js",
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.esm.js"
13
+ },
14
+ "./alpha": {
15
+ "backstage": "@backstage/FrontendModule",
16
+ "import": "./dist/alpha.esm.js",
17
+ "types": "./dist/alpha.d.ts",
18
+ "default": "./dist/alpha.esm.js"
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "typesVersions": {
23
+ "*": {
24
+ "alpha": [
25
+ "dist/alpha.d.ts"
26
+ ],
27
+ "package.json": [
28
+ "package.json"
29
+ ]
30
+ }
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/redhat-developer/rhdh-plugins",
38
+ "directory": "workspaces/app-defaults/plugins/app-auth"
39
+ },
40
+ "backstage": {
41
+ "role": "frontend-plugin",
42
+ "pluginId": "app-auth",
43
+ "pluginPackages": [
44
+ "@red-hat-developer-hub/backstage-plugin-app-auth"
45
+ ],
46
+ "features": {
47
+ "./alpha": "@backstage/FrontendModule"
48
+ }
49
+ },
50
+ "jest": {
51
+ "testEnvironment": "@internal/jest-environment-jsdom-suppress-css"
52
+ },
53
+ "sideEffects": false,
54
+ "configSchema": "config.d.ts",
55
+ "scripts": {
56
+ "start": "backstage-cli package start",
57
+ "build": "backstage-cli package build",
58
+ "lint": "backstage-cli package lint",
59
+ "test": "backstage-cli package test",
60
+ "clean": "backstage-cli package clean",
61
+ "prepack": "backstage-cli package prepack",
62
+ "postpack": "backstage-cli package postpack"
63
+ },
64
+ "dependencies": {
65
+ "@backstage/core-app-api": "^1.19.6",
66
+ "@backstage/core-components": "^0.18.8",
67
+ "@backstage/core-plugin-api": "^1.12.4",
68
+ "@backstage/frontend-plugin-api": "^0.15.1",
69
+ "@backstage/plugin-app": "^0.4.2",
70
+ "@mui/material": "5.18.0"
71
+ },
72
+ "peerDependencies": {
73
+ "react": "^16.13.1 || ^17.0.0 || ^18.0.0"
74
+ },
75
+ "devDependencies": {
76
+ "@backstage/cli": "^0.36.0",
77
+ "@backstage/test-utils": "^1.7.16",
78
+ "@internal/jest-environment-jsdom-suppress-css": "^0.0.0",
79
+ "@testing-library/jest-dom": "^6.0.0",
80
+ "@testing-library/react": "^16.0.0",
81
+ "@types/react": "^18",
82
+ "@types/react-dom": "^18",
83
+ "cross-fetch": "^4.0.0",
84
+ "react": "^16.13.1 || ^17.0.0 || ^18.0.0",
85
+ "react-dom": "^18.0.2",
86
+ "react-router-dom": "^6.30.2"
87
+ },
88
+ "files": [
89
+ "dist",
90
+ "config.d.ts"
91
+ ],
92
+ "module": "./dist/index.esm.js"
93
+ }