【发布时间】:2022-02-08 18:28:26
【问题描述】:
我正在使用 angular-oauth2-oidc 进行身份验证,但我不知道如何获取访问令牌。我正在使用带有此配置的 PKCE 代码流
authConfig: AuthConfig = {
issuer: 'https://test.com/oauth/token',
// requireHttps: false,
redirectUri:'http://localhost:4200/',
strictDiscoveryDocumentValidation: false,
tokenEndpoint: 'https://test.com/oauth/token',
clientId: 'test',
// dummyClientSecret: 'test',
scope: 'openid',
oidc: true,
responseType: 'code',
showDebugInformation: true,
requestAccessToken: true
};
使用此代码启动流程,登录后重定向但我无法获得任何令牌。
getAutherizationCodeWithPKCE() {
this.oauthService.configure(this.authConfig);
this.oauthService.initCodeFlow();
this.oauthService.loadDiscoveryDocumentAndTryLogin
}
【问题讨论】:
-
检查从 angular-oauth2-oidc github 及其 auth.service.ts 引用的 sample project。
-
这是较旧的项目,我正在使用 PKCE 流程。
标签: angular oauth-2.0 pkce angular-oauth2-oidc angular-auth-oidc-client