Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
OAuth2 y SSO con angular-oauth2-oidc no recuperarán el token de acceso

aquí está mi problema

Estoy tratando de implementar el flujo SSO y OAuth2 con angular-oauth2-oidc. Puedo obtener la respuesta correcta (el token de acceso) usando POSTMAN y ThunderClient (código VS), pero no con Angular

Aquí está mi configuración:

 authCodeFlowConfig: AuthConfig = { issuer: 'https://URL.com/', loginUrl: 'https://URL.com/authorize-client', clientId: environment.API.CLIENT_ID, responseType: 'code', scope: environment.API.SCOPE, tokenEndpoint: 'https://URL.com/request-access', dummyClientSecret: environment.API.CLIENT_SECRET, redirectUri: window.location.origin, showDebugInformation: true, } ... constructor( private httpClient: HttpClient, private oauthService: OAuthService ) { this.getAuthorizeClientCode() } ... getAuthorizeClientCode() { this.oauthService.configure(this.authCodeFlowConfig); this.oauthService.tokenValidationHandler = new JwksValidationHandler() this.oauthService.tryLogin({ onTokenReceived: context => { console.log(context) } }) .then(() => { if (this.oauthService.hasValidAccessToken()) { this.oauthService.silentRefresh() } else { this.oauthService.initCodeFlow(); } }) .catch(err => console.log(err)) }

Qué sucede: El flujo funciona hasta un punto. Hago el inicio de sesión y obtiene el código y llamo al punto final 'request_access', pero eso es todo, el punto final del token me arroja un error:

ingrese la descripción de la imagen aquí

Cuando reviso la pestaña de red, la información está allí:

ingrese la descripción de la imagen aquí

Busqué en todas partes y realmente no sé lo que me estoy perdiendo ya que el flujo funciona en POSTMAN, pero no en Angular.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe habilitar cors en el backend, puede instalar estas herramientas en Chrome para deshabilitar eso para la prueba

https://chrome.google.com/webstore/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbchttps://

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!