Created
October 19, 2023 13:13
-
-
Save angeliski/efac597811628bf409ac430a6d192ad7 to your computer and use it in GitHub Desktop.
Backstage auth0 example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
createRouter, | |
providers, | |
defaultAuthProviderFactories, | |
} from '@backstage/plugin-auth-backend'; | |
import {Router} from 'express'; | |
import {PluginEnvironment} from '../types'; | |
export default async function createPlugin( | |
env: PluginEnvironment, | |
): Promise<Router> { | |
return await createRouter({ | |
logger: env.logger, | |
config: env.config, | |
database: env.database, | |
discovery: env.discovery, | |
tokenManager: env.tokenManager, | |
providerFactories: { | |
// all providers | |
...defaultAuthProviderFactories, | |
// or just auth0 | |
auth0: providers.auth0.create(), | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment