26 lines
786 B
JavaScript
26 lines
786 B
JavaScript
import { userHttp } from './http'
|
|
|
|
export const getOidcAuthorizeUrl = (redirectUri, options = {}) =>
|
|
userHttp.get('/auth/oidc/url', {
|
|
params: {
|
|
redirect_uri: redirectUri,
|
|
login_hint: options.loginHint || undefined,
|
|
prompt: options.prompt || undefined,
|
|
idp_hint: options.idpHint || undefined,
|
|
code_challenge: options.codeChallenge || undefined,
|
|
code_challenge_method: options.codeChallengeMethod || undefined
|
|
}
|
|
})
|
|
|
|
export const exchangeOidcCode = (code, redirectUri, codeVerifier) =>
|
|
userHttp.post('/auth/oidc/exchange', {
|
|
code,
|
|
redirect_uri: redirectUri,
|
|
code_verifier: codeVerifier || undefined
|
|
})
|
|
|
|
export const refreshOidcToken = (refreshToken) =>
|
|
userHttp.post('/auth/refresh', {
|
|
refresh_token: refreshToken
|
|
})
|