mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 13:20:19 +08:00
feat: add OIDC feature support. (#373)
1. add nonce parameter. 2. add sub in userinfo endpoint. Signed-off-by: 0x2a <stevesough@gmail.com>
This commit is contained in:
@ -44,7 +44,7 @@ function oAuthParamsToQuery(oAuthParams) {
|
||||
}
|
||||
|
||||
// code
|
||||
return `?clientId=${oAuthParams.clientId}&responseType=${oAuthParams.responseType}&redirectUri=${oAuthParams.redirectUri}&scope=${oAuthParams.scope}&state=${oAuthParams.state}`;
|
||||
return `?clientId=${oAuthParams.clientId}&responseType=${oAuthParams.responseType}&redirectUri=${oAuthParams.redirectUri}&scope=${oAuthParams.scope}&state=${oAuthParams.state}&nonce=${oAuthParams.nonce}`;
|
||||
}
|
||||
|
||||
export function getApplicationLogin(oAuthParams) {
|
||||
|
@ -82,6 +82,7 @@ export function getOAuthGetParameters(params) {
|
||||
const redirectUri = queries.get("redirect_uri");
|
||||
const scope = queries.get("scope");
|
||||
const state = queries.get("state");
|
||||
const nonce = queries.get("nonce")
|
||||
|
||||
if (clientId === undefined || clientId === null) {
|
||||
// login
|
||||
@ -94,6 +95,7 @@ export function getOAuthGetParameters(params) {
|
||||
redirectUri: redirectUri,
|
||||
scope: scope,
|
||||
state: state,
|
||||
nonce: nonce,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user