From 876a5351d87572c74bb38729d413babfd8d7a846 Mon Sep 17 00:00:00 2001 From: Fabian Hippmann Date: Tue, 6 Jul 2021 12:10:59 +0200 Subject: [PATCH] update documentation location Signed-off-by: Fabian Hippmann --- .../auth/google}/gcp-iap-auth.md | 19 +++++++++++-------- .../src/providers/gcp-iap/provider.ts | 13 +++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) rename {contrib/docs/tutorials => docs/auth/google}/gcp-iap-auth.md (88%) diff --git a/contrib/docs/tutorials/gcp-iap-auth.md b/docs/auth/google/gcp-iap-auth.md similarity index 88% rename from contrib/docs/tutorials/gcp-iap-auth.md rename to docs/auth/google/gcp-iap-auth.md index c2ec031467..2188ca5465 100644 --- a/contrib/docs/tutorials/gcp-iap-auth.md +++ b/docs/auth/google/gcp-iap-auth.md @@ -1,10 +1,17 @@ -# Using AWS Application Load Balancer with Azure Active Directory to authenticate requests +--- +id: provider +title: Google Identity Aware Proxy Provider +sidebar_label: Google IAP +description: Adding Google Identity Aware Proxy as an authentication provider in Backstage +--- + +# Using Google Identity Aware Proxy to authenticate requests + +Backstage allows offloading the responsibility of authenticating users to an Google HTTPS Load Balancer & [IAP](https://cloud.google.com/iap), leveraging the authentication support on IAP. -Backstage allows offloading the responsibility of authenticating users to an AWS Application Load Balancer (**ALB**), leveraging the authentication support on ALB. This tutorial shows how to use authentication on an ALB sitting in front of Backstage. -Azure Active Directory (**AAD**) is used as identity provider but any identity provider supporting OpenID Connect (OIDC) can be used. -It is assumed an ALB is already serving traffic in front of a Backstage instance configured to serve the frontend app from the backend. +It is assumed an IAP is already serving traffic in front of a Backstage instance configured to serve the frontend app from the backend. ## Infrastructure setup @@ -133,7 +140,3 @@ auth: ## Conclusion Once it's deployed, after going through the AAD authentication flow, Backstage should display the AAD user details. - - - -[monorepo-app-setup-with-auth-ms]: https://backstage.io/docs/auth/microsoft/provider diff --git a/plugins/auth-backend/src/providers/gcp-iap/provider.ts b/plugins/auth-backend/src/providers/gcp-iap/provider.ts index 1d6f5c3d5e..0226855a88 100644 --- a/plugins/auth-backend/src/providers/gcp-iap/provider.ts +++ b/plugins/auth-backend/src/providers/gcp-iap/provider.ts @@ -18,21 +18,18 @@ import { AuthProviderRouteHandlers, AuthResponse } from '@backstage/plugin-auth-backend'; + +import { + ExperimentalIdentityResolver, +} from '../types'; import express from 'express'; import { Logger } from 'winston'; import { CatalogApi } from '@backstage/catalog-client'; -const { OAuth2Client } = require('google-auth-library'); +import { OAuth2Client } from 'google-auth-library'; const IAP_JWT_HEADER = 'x-goog-iap-jwt-assertion'; -export type ExperimentalIdentityResolver = ( - /** - * An object containing information specific to the auth provider. - */ - payload: object, - catalogApi: CatalogApi, -) => Promise>; export type GcpIAPProviderOptions = { audience: string; identityResolutionCallback: ExperimentalIdentityResolver;