-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Align environment variables between consoles #30125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6b94d10
change to make authServerUrl the same as authUrl
edewit 2570ee9
Remove `authUrl` entirely
jonkoops 3ed22f4
Remove file that is unrelated
jonkoops 4094818
Split out and align environment variables between consoles
jonkoops 0a420fb
Restore removed variables to preserve backwards compatibility
jonkoops 5a258b3
Also deprecate the `authUrl` for the Admin Console
jonkoops File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { | ||
| getInjectedEnvironment, | ||
| type BaseEnvironment, | ||
| } from "@keycloak/keycloak-ui-shared"; | ||
|
|
||
| export type Environment = BaseEnvironment & { | ||
| /** The URL to the root of the account console. */ | ||
| baseUrl: string; | ||
| /** The locale of the user */ | ||
| locale: string; | ||
| /** Name of the referrer application in the back link */ | ||
| referrerName?: string; | ||
| /** UR to the referrer application in the back link */ | ||
| referrerUrl?: string; | ||
| /** Feature flags */ | ||
| features: Feature; | ||
| }; | ||
|
|
||
| export type Feature = { | ||
| isRegistrationEmailAsUsername: boolean; | ||
| isEditUserNameAllowed: boolean; | ||
| isLinkedAccountsEnabled: boolean; | ||
| isMyResourcesEnabled: boolean; | ||
| deleteAccountAllowed: boolean; | ||
| updateEmailFeatureEnabled: boolean; | ||
| updateEmailActionEnabled: boolean; | ||
| isViewGroupsEnabled: boolean; | ||
| isOid4VciEnabled: boolean; | ||
| }; | ||
|
|
||
| // During development the realm can be passed as a query parameter when redirecting back from Keycloak. | ||
| const realm = | ||
| new URLSearchParams(window.location.search).get("realm") || | ||
| location.pathname.match("/realms/(.*?)/account")?.[1] || | ||
| "master"; | ||
|
|
||
| const defaultEnvironment: Environment = { | ||
| // Base environment variables | ||
| authServerUrl: "http://localhost:8180", | ||
| realm: realm, | ||
| clientId: "security-admin-console-v2", | ||
| resourceUrl: "http://localhost:8080", | ||
| logo: "/logo.svg", | ||
| logoUrl: "/", | ||
| // Account Console specific environment variables | ||
| baseUrl: `http://localhost:8180/realms/${realm}/account/`, | ||
| locale: "en", | ||
| features: { | ||
| isRegistrationEmailAsUsername: false, | ||
| isEditUserNameAllowed: true, | ||
| isLinkedAccountsEnabled: true, | ||
| isMyResourcesEnabled: true, | ||
| deleteAccountAllowed: true, | ||
| updateEmailFeatureEnabled: true, | ||
| updateEmailActionEnabled: true, | ||
| isViewGroupsEnabled: true, | ||
| isOid4VciEnabled: true, | ||
| }, | ||
| }; | ||
|
|
||
| export const environment = getInjectedEnvironment(defaultEnvironment); |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure about this one? Is it true @vmuzikar, that we only need one url in the admin ui?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not referenced anywhere in the templates or JS code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it was used https://github.com/keycloak/keycloak/pull/30125/files#diff-59cd7df86bacac814b984d485e647e3db6a6011e45a75fbc863bef9d748842fdL27 both
authUrlandauthServerUrlare used in the admin ui