You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new app with the following command npx @backstage/create-app
Add Okta provider via yarn with command yarn --cwd packages/backend add @backstage/plugin-auth-backend-module-okta-provider
Add Okta provider import to packages/backend/src/index.ts - backend.add(import('@backstage/plugin-auth-backend-module-okta-provider'));
Update frontend with correct Okta sign in button
import{oktaAuthApiRef}from'@backstage/core-plugin-api';constapp=createApp({// Other stuffcomponents: {SignInPage: props=>(<SignInPage{...props}autoproviders={['guest',{id: 'okta-auth-provider',title: 'Okta',message: 'Sign in using Okta',apiRef: oktaAuthApiRef,}]}/>),},});
Once app has fully started, click on Okta sign in button
A popup should appear with an error stating Auth provider registered for 'okta' is misconfigured.. This is expected, since the ENV variables result in blanks strings.
Kill the app
Update config, replacing all ENV variables with testing123
Run app again with command NODE_ENV=development yarn dev
Once app has fully started, click on Okta sign in button
A popup should appear with an error stating Unknown auth provider 'okta', This is unexpected, as it should have reached out to Okta in an attempt to open up the Okta sign in page.
Kill the app
Update the config, removing the clientSecret field value (set it to blank string)
Run app again with command NODE_ENV=development yarn dev
Once app has fully started, click on Okta sign in button
A popup should appear with an error stating Auth provider registered for 'okta' is misconfigured.. This is expected, since the clientSecret field is blank, and not configured.
As you can see from this flow, providing a clientSecret seemingly breaks the Okta auth provider for some reason. No error or warning logs of any kind are created, even when running the all with LOG_LEVEL=debug.
The audience option is important, if you set it to something like testing123 it'll be treated as a relative URL and result in a 404 since something like testing123/oauth2/v1/authorize?... doesn't exist. Try configuring a real audience that points to your Okta server, or leave it as the default http://okta.com. The audience should not point to the Backstage instance.
The audience option is important, if you set it to something like testing123 it'll be treated as a relative URL and result in a 404 since something like testing123/oauth2/v1/authorize?... doesn't exist. Try configuring a real audience that points to your Okta server, or leave it as the default http://okta.com. The audience should not point to the Backstage instance.
@Rugvip But it's not even getting to that part since it's not even finding the Okta provider (unlike when I have the secret blank, which it will then say that it's misconfigured). To be clear (as per my 2nd comment), I have tried this with the actual values that I get from setting up the App in Okta and the same thing still happens.
@synackSA It's getting past that point, because the error is from /api/auth/okta/<redacted>/oauth2/v1/authorize, which isn't a valid endpoint on the auth plugin. That or the frontend is trying to access that endpoint directly, which would also be an error.
📜 Description
Providing a
clientSecret
for theokta
auth provider results in an errorUnknown auth provider 'okta'
.👍 Expected behavior
Connect to Okta for Authentication
👎 Actual Behavior with Screenshots
Get the following error
👟 Reproduction steps
npx @backstage/create-app
yarn
with commandyarn --cwd packages/backend add @backstage/plugin-auth-backend-module-okta-provider
packages/backend/src/index.ts
-backend.add(import('@backstage/plugin-auth-backend-module-okta-provider'));
Optional
fields: https://backstage.io/docs/auth/okta/provider/#configurationNODE_ENV=development yarn dev
Auth provider registered for 'okta' is misconfigured.
. This is expected, since the ENV variables result in blanks strings.testing123
NODE_ENV=development yarn dev
Unknown auth provider 'okta'
, This is unexpected, as it should have reached out to Okta in an attempt to open up the Okta sign in page.clientSecret
field value (set it to blank string)NODE_ENV=development yarn dev
Auth provider registered for 'okta' is misconfigured.
. This is expected, since theclientSecret
field is blank, and not configured.As you can see from this flow, providing a
clientSecret
seemingly breaks the Okta auth provider for some reason. No error or warning logs of any kind are created, even when running the all withLOG_LEVEL=debug
.📃 Provide the context for the Bug.
N/A
🖥️ Your Environment
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Code of Conduct?
Are you willing to submit PR?
No, I don't have time to work on this right now
The text was updated successfully, but these errors were encountered: