-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: John Gomersall <[email protected]>
- Loading branch information
Showing
3 changed files
with
21 additions
and
26 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const urlParams = new URLSearchParams(window.location.search); | ||
|
||
export const clientId = urlParams.get('clientId'); | ||
export const clientSecret = urlParams.get('clientSecret'); | ||
export const lang = urlParams.get('lang'); | ||
export const keycloak = decodeURIComponent(urlParams.get('keycloak')); | ||
export const code = urlParams.get("code"); | ||
export const error = urlParams.get("error"); | ||
|
||
export function login() { | ||
const nonce = crypto.getRandomValues(new BigUint64Array(1))[0]; | ||
const url = `${keycloak}/protocol/openid-connect/auth?response_type=code&client_id=${clientId}&redirect_uri=${ | ||
encodeURIComponent(`http://localhost:5604/code.html?clientId=${clientId}&clientSecret=${clientSecret}&lang=${lang}&keycloak=${encodeURIComponent(keycloak)}`) | ||
}&scope=openid+profile+offline_access&state=${nonce}&ui_locales=${lang}`; | ||
window.location = url; | ||
} |
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