From c2386e9e860325f43775d700a016b91ecd7053d0 Mon Sep 17 00:00:00 2001
From: Jussi Hallila
+
1. Open `app-config.yaml` and change it as follows
_from:_
@@ -75,23 +82,224 @@ auth:
$env: AUTH_GITHUB_CLIENT_ID
clientSecret:
$env: AUTH_GITHUB_CLIENT_SECRET
- ## uncomment the following three lines if using enterprise
+ ## uncomment the following two lines if using enterprise
# enterpriseInstanceUrl:
# $env: AUTH_GITHUB_ENTERPRISE_INSTANCE_URL
```
-2. Set environment variables in whatever fashion is easiest for you. I chose to
+2. Generate Github client id and secret
+
+- Log into http://github.com
+- Navigate to (Settings > Developer Settings > OAuth Apps > New OAuth
+ App)[https://github.com/settings/applications/new]
+- Set Homepage URL = http://localhost:3000
+- Set Callback URL = http://localhost:7000/api/auth/github
+- Click [Register application]
+- On the next page, copy and paste your new Client ID and Client Secret to
+ environment variables defined in the `app-config.yaml` file,
+ `AUTH_GITHUB_CLIENT_ID` & `AUTH_GITHUB_CLIENT_SECRET`
+
+
+
+1. Open `app-config.yaml` and change it as follows
+
+_from:_
+
+```yaml
+auth:
+ providers: {}
+```
+
+_to:_
+
+```yaml
+auth:
+ providers:
+ gitlab:
+ development:
+ clientId:
+ $env: AUTH_GITLAB_CLIENT_ID
+ clientSecret:
+ $env: AUTH_GITLAB_CLIENT_SECRET
+ audience: https://gitlab.com # Or your self-hosted Gitlab instance URL
+```
+
+2. Generate Gitlab Application for client id and secret
+
+- Log into Gitlab
+- Navigate to (Profile > Settings >
+ Applications)[https://gitlab.com/-/profile/applications]
+- Name your application
+- Set Callback URL = http://localhost:7000/api/auth/gitlab/handler/frame
+- Select the following values:
+ - `read_user (Read the authenticated user's personal information)`
+ - `read_repository (Allows read-only access to the repository)`
+ - `write_repository (Allows read-write access to the repository)`
+ - `openid (Authenticate using OpenID Connect)`
+ - `profile (Allows read-only access to the user's personal information using OpenID Connect)`
+ - `email (Allows read-only access to the user's primary email address using OpenID Connect)`
+- Click [Save application]
+- On the next page, copy and paste your new Application ID and Secret to
+ environment variables defined in the `app-config.yaml` file,
+ `AUTH_GITLAB_CLIENT_ID` & `AUTH_GITLAB_CLIENT_SECRET`
+
+
+
+1. Open `app-config.yaml` and change it as follows
+
+_from:_
+
+```yaml
+auth:
+ providers: {}
+```
+
+_to:_
+
+```yaml
+auth:
+ providers:
+ google:
+ development:
+ clientId:
+ $env: AUTH_GOOGLE_CLIENT_ID
+ clientSecret:
+ $env: AUTH_GOOGLE_CLIENT_SECRET
+```
+
+2. Generate Google Application in Google Cloud console
+
+- Log into https://console.cloud.google.com
+- Select or create a new project from the dropdown on the top bar
+- Navigate to (APIs & Services - >
+ Credentials)[https://console.cloud.google.com/apis/credentials]
+- Add new Authorised JavaScript origin = `http://localhost:3000`
+- Add new Authorised redirect URI =
+ `http://localhost:7000/api/auth/google/handler/frame`
+- Click [Save application]
+- Google should display a modal with your Client ID and Secret. Copy and paste
+ those to environment variables defined in the `app-config.yaml` file,
+ `AUTH_GOOGLE_CLIENT_ID` & `AUTH_GOOGLE_CLIENT_SECRET`
+
+
+
+1. Open `app-config.yaml` and change it as follows
+
+_from:_
+
+```yaml
+auth:
+ providers: {}
+```
+
+_to:_
+
+```yaml
+auth:
+ providers:
+ microsoft:
+ development:
+ clientId:
+ $env: AUTH_MICROSOFT_CLIENT_ID
+ clientSecret:
+ $env: AUTH_MICROSOFT_CLIENT_SECRET
+ tenantId:
+ $env: AUTH_MICROSOFT_TENANT_ID
+```
+
+2. Create Microsoft Directory in Microsoft Portal
+
+- Log into https://portal.azure.com
+- Navigate to (Azure Active Directory -> App
+ Registrations)[https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps]
+- Create a New Registration
+- Add new Redirect URI = `http://localhost:3000`
+- Add new Authorised redirect URI =
+ `http://localhost:7000/api/auth/microsoft/handler/frame`
+- Click [Save application]
+- Set environment variable `AUTH_MICROSOFT_CLIENT_ID` from
+ `Application (client) Id` displayed on the directory page
+- Set environment variable `AUTH_MICROSOFT_TENANT_ID` from
+ `Directory (tenant) ID` displayed on the directory page
+- Navigate to Certificates & Secrets section and click [Create a new secret]
+- Set environment variable `AUTH_MICROSOFT_CLIENT_SECRET` from the `value` field
+ created.
+
+
+
+1. Open `app-config.yaml` and change it as follows
+
+_from:_
+
+```yaml
+auth:
+ providers: {}
+```
+
+_to:_
+
+```yaml
+auth:
+ providers:
+ auth0:
+ development:
+ clientId:
+ $env: AUTH_AUTH0_CLIENT_ID
+ clientSecret:
+ $env: AUTH_AUTH0_CLIENT_SECRET
+ domain:
+ $env: AUTH_AUTH0_DOMAIN_ID
+```
+
+2. Create Auth0 application in Auth0 management console
+
+- Log into https://manage.auth0.com/dashboard/
+- Navigate to Applications
+- Create a New Application
+ - Select Single Page Web Application
+- Go to Settings tab
+- Add new line to Allowed Callback URLs =
+ `http://localhost:7000/api/auth/auth0/handler/frame`
+- Click [Save Changes]
+- Set environment variables displayed on the Basic Information page
+ - `AUTH_AUTH0_CLIENT_ID` from `Client ID` displayed on Auth0 application page
+ - `AUTH_AUTH0_CLIENT_SECRET` from `Client Secret` displayed on Auth0
+ application page
+ - `AUTH_AUTH0_DOMAIN_ID` from `Domain` displayed on Auth0 application page
+
+
> This document takes you through setting up a Backstage app that runs in your
> own environment. It starts with a skeleton install and verifying of the
-> monorepo's functionality. Next, GitHub authentication is added and tested.
+> monorepo's functionality. Next, authentication is added and tested.
>
> This document assumes you have Node.js 12 active along with Yarn and Python.
-> Please note, that at the time of this writing, the current version is
-> 0.1.1-alpha.21. This guide can still be used with future versions, just,
-> verify as you go. If you run into issues, you can compare your setup with mine
-> here >
-> [simple-backstage-app](https://github.com/johnson-jesse/simple-backstage-app).
+> Please note, that at the time of this writing, the current version is v0.4.5
+> This guide can still be used with future versions, just, verify as you go.
# The Skeleton Application
@@ -55,6 +52,16 @@ guest. Let's fix that now and add auth.
# The Auth Configuration
+Default Backstage installation includes multiple authentication providers out of
+the box. The steps to enable new authentication provider in Backstage are very
+similar to each other, the biggest difference is usually configuring the
+external authentication provider. Please see a subset of possible providers and
+instructions to integrate them below. Steps 1 & 2 are described separately for
+each provider and steps beyond that are common for all.
+
+Github
+Gitlab
+Google
+Microsoft
+Auth0
+
1. Open `app-config.yaml` and change it as follows
From 72399d57e5612b6198bce30efd2910ab67effef4 Mon Sep 17 00:00:00 2001
From: Jussi Hallila
-1. Open `app-config.yaml` and change it as follows
+### 1. Open `app-config.yaml` and change it as follows
_from:_
@@ -88,7 +88,7 @@ auth:
# $env: AUTH_GITHUB_ENTERPRISE_INSTANCE_URL
```
-2. Generate a GitHub client ID and secret
+### 2. Generate a GitHub client ID and secret
- Log into http://github.com
- Navigate to (Settings > Developer Settings > OAuth Apps > New OAuth
@@ -106,7 +106,7 @@ auth:
-1. Open `app-config.yaml` and change it as follows
+### 1. Open `app-config.yaml` and change it as follows
_from:_
@@ -129,7 +129,7 @@ auth:
audience: https://gitlab.com # Or your self-hosted Gitlab instance URL
```
-2. Generate a GitLab Application client ID and secret
+### 2. Generate a Gitlab Application client ID and secret
- Log into GitLab
- Navigate to (Profile > Settings >
@@ -137,12 +137,14 @@ auth:
- Name your application
- Set Callback URL = http://localhost:7000/api/auth/gitlab/handler/frame
- Select the following values:
- - `read_user (Read the authenticated user's personal information)`
- - `read_repository (Allows read-only access to the repository)`
- - `write_repository (Allows read-write access to the repository)`
- - `openid (Authenticate using OpenID Connect)`
- - `profile (Allows read-only access to the user's personal information using OpenID Connect)`
- - `email (Allows read-only access to the user's primary email address using OpenID Connect)`
+ - `read_user` (Read the authenticated user's personal information)
+ - `read_repository` (Allows read-only access to the repository)
+ - `write_repository` (Allows read-write access to the repository)
+ - `openid` (Authenticate using OpenID Connect)
+ - `profile` (Allows read-only access to the user's personal information using
+ OpenID Connect)
+ - `email` (Allows read-only access to the user's primary email address using
+ OpenID Connect)
- Click [Save application]
- On the next page, copy and paste your new Application ID and Secret to
environment variables defined in the `app-config.yaml` file,
@@ -154,7 +156,7 @@ auth:
-1. Open `app-config.yaml` and change it as follows
+### 1. Open `app-config.yaml` and change it as follows
_from:_
@@ -176,12 +178,14 @@ auth:
$env: AUTH_GOOGLE_CLIENT_SECRET
```
-2. Generate Google Credentials in Google Cloud console
+### 2. Generate Google Credentials in Google Cloud console
- Log into https://console.cloud.google.com
- Select or create a new project from the dropdown on the top bar
- Navigate to (APIs & Services >
Credentials)[https://console.cloud.google.com/apis/credentials]
+- Click Create Credentials and select [OAuth client ID]
+- Select Web Application as the application type
- Add new Authorised JavaScript origin = `http://localhost:3000`
- Add new Authorised redirect URI =
`http://localhost:7000/api/auth/google/handler/frame`
@@ -196,7 +200,7 @@ auth:
-1. Open `app-config.yaml` and change it as follows
+### 1. Open `app-config.yaml` and change it as follows
_from:_
@@ -220,7 +224,7 @@ auth:
$env: AUTH_MICROSOFT_TENANT_ID
```
-2. Create a Microsoft App Registration in Microsoft Portal
+### 2. Create a Microsoft App Registration in Microsoft Portal
- Log into https://portal.azure.com
- Navigate to (Azure Active Directory > App
@@ -244,7 +248,7 @@ auth:
-1. Open `app-config.yaml` and change it as follows
+### 1. Open `app-config.yaml` and change it as follows
_from:_
@@ -268,7 +272,7 @@ auth:
$env: AUTH_AUTH0_DOMAIN_ID
```
-2. Create an Auth0 application in the Auth0 management console
+### 2. Create an Auth0 application in the Auth0 management console
- Log into https://manage.auth0.com/dashboard/
- Navigate to Applications
@@ -287,8 +291,9 @@ auth:
### 1. Open `app-config.yaml` and change it as follows
From e921fb2ec7428029748ad4d5a109a32ebde437ea Mon Sep 17 00:00:00 2001
From: Jussi Hallila
### 1. Open `app-config.yaml` and change it as follows
@@ -334,7 +334,7 @@ above:
| Auth Provider | Import Name |
| ------------- | ------------------- |
-| Github | githubAuthApiRef |
+| GitHub | githubAuthApiRef |
| Gitlab | gitlabAuthApiRef |
| Google | googleAuthApiRef |
| Microsoft | microsoftAuthApiRef |
From 37e4bf3473a1f399f572eb7bdcb636f57204ebd8 Mon Sep 17 00:00:00 2001
From: Jussi Hallila
### 1. Open `app-config.yaml` and change it as follows
@@ -126,16 +126,16 @@ auth:
$env: AUTH_GITLAB_CLIENT_ID
clientSecret:
$env: AUTH_GITLAB_CLIENT_SECRET
- audience: https://gitlab.com # Or your self-hosted Gitlab instance URL
+ audience: https://gitlab.com # Or your self-hosted GitLab instance URL
```
-### 2. Generate a Gitlab Application client ID and secret
+### 2. Generate a GitLab Application client ID and secret
- Log into GitLab
- Navigate to (Profile > Settings >
Applications)[https://gitlab.com/-/profile/applications]
- Name your application
-- Set Callback URL = http://localhost:7000/api/auth/gitlab/handler/frame
+- Set Callback URL = `http://localhost:7000/api/auth/gitlab/handler/frame`
- Select the following values:
- `read_user` (Read the authenticated user's personal information)
- `read_repository` (Allows read-only access to the repository)
@@ -335,7 +335,7 @@ above:
| Auth Provider | Import Name |
| ------------- | ------------------- |
| GitHub | githubAuthApiRef |
-| Gitlab | gitlabAuthApiRef |
+| GitLab | gitlabAuthApiRef |
| Google | googleAuthApiRef |
| Microsoft | microsoftAuthApiRef |
| Auth0 | auth0AuthApiRef |
Github
GitLab
Google
Microsoft
Auth0
GitLab
+Gitlab
Github
+GitHub
Gitlab
+GitLab