damienbod / angular-auth-oidc-client

npm package for OpenID Connect, OAuth Code Flow with PKCE, Refresh tokens, Implicit Flow
https://www.npmjs.com/package/angular-auth-oidc-client
MIT License
1.13k stars 429 forks source link

[Bug]: Creating Custom Token Validation Service is not possible due to not exported service #1370

Open soners opened 2 years ago

soners commented 2 years ago

What Version of the library are you using? angular-auth-oidc-client v12.0.3 Angular 12.2.0 Node v16.11.0 NPM 8.0.0

Describe the bug Creating Custom Token Validation Service is not possible, because JsrsAsignReducedService is not exported. (see screenshot 1 and 2 for exported classes and error message respectively)

To Reproduce Steps to reproduce the behavior:

  1. Create an angular 12 project -> npx -p @angular/cli@12.2.15 ng new angular-oauth
  2. Install angular-auth-oidc-client library -> npm install angular-auth-oidc-client v12.0.3
  3. Create custom token validation service -> ng generate service custom-token-validation-service
  4. Inherit TokenValidationService in CustomTokenValidationService
  5. Create constructor with necessary dependencies (check screenshot 3 for the implementation)
  6. Provide this service in app module (check screenshot 4 for the implementation)

Expected behavior JsrsAsignReducedService is exported so that we can create custom token validation services.

Screenshots Screenshot 1 -> Exported classes image

Screenshot 2-> Error message image

Screenshot 3 -> Service implementation image

Screenshot 4 -> App Module image

Desktop (please complete the following information):

Additional context Same error can be reproduced with Angular 13 and angular-auth-oidc-client v13.1.0. JwtWindowCryptoService is not exported, however it is a dependency of TokenValidationService.

FabianGosebrink commented 2 years ago

Why do you want to create a token validation services for yourself? What functionality do you need which the lib does not offer? Should we provide a method through the facade instead? Thanks

soners commented 2 years ago

Hello @FabianGosebrink.

Thank you for your reply and sincere apologies for the late reply. I was on a mission to gather information on why we needed to inherit before.

This is the code piece that does the work that TokenValidationService was not capable of in version 11. Do you know if you received any bug reports about this or this was resolved in later versions? image

FabianGosebrink commented 1 year ago

Is this issue still relevant?