Closed snowchenlei closed 1 year ago
Yes this is quite easy to do.
One of the authors helped me to this replacement provider. Put this in your app module providers array:
{
provide: OAuthService,
useValue: {
hasValidAccessToken: () => true, // return token status
configure: () => {
},
loadDiscoveryDocument: () => Promise.resolve(),
events: of(),
tryLogin: () => {
},
setupAutomaticSilentRefresh: () => {
},
getAccessToken: () => '' // return access token
}
},
I can tell you this works as this has been running in production like this.
Thank you very much for your answer but now i use ng-alain This combination became difficult after 4.4
I do agree with you that oAuth is quite hard to remove from the angular setup. But then I must also add that my setup (and yours) deviate quite a lot from the path that Abp has set out as default.
Hopefully the team and us can come to a good mid-way in this triage!
we have removed authentication packages from the core. If you an ABP user want to implement your own authentication flow, the user can do it much easier. I also documented which function or interface should be overridden.
here the docs. https://github.com/abpframework/abp/pull/15261 here the PR. That feature released with v7.0.0-rc6. https://github.com/abpframework/abp/pull/15201
Abp uses the oauth by default to login. However, in some scenarios, we do not use oauth, we use jwt instead. But when environment.oAuthConfig does not exist, it will get error Can you move the oauth related to a separate package?