You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
976 B
21 lines
976 B
import Oidc from "oidc-client";
|
|
|
|
export const identityServerBase = localStorage.getItem('oidcLogin_url');//目标服务器登录地址
|
|
export const vueBase = window.location.origin
|
|
|
|
// 参考文档 https://github.com/IdentityModel/oidc-client-js/wiki
|
|
export const mgr = new Oidc.UserManager({
|
|
authority: `${identityServerBase}`, // 认证服务器
|
|
client_id: localStorage.getItem('oidcLogin_clientId'), // 表示客户端的ID,必选项
|
|
redirect_uri: `${vueBase}/callback`,// 表示重定向URI,认证服务器回调的客户端页面。可选项
|
|
response_type: `code`,
|
|
scope: localStorage.getItem('oidcLogin_scopes'), // 表示申请的权限范围,可选项
|
|
post_logout_redirect_uri: `${vueBase}/home?action=logout`,
|
|
automaticSilentRenew: false,
|
|
|
|
// accessTokenExpiringNotificationTime: 10,
|
|
// filterProtocolClaims: false,
|
|
// loadUserInfo: true,
|
|
// monitorSession: false,
|
|
// includeIdTokenInSilentRenew : false,
|
|
});
|