Using useOidcAccessToken and/or useOidcFetch not Working
See original GitHub issueIssue and Steps to Reproduce
I am trying to fetch data from an API (different server that is specified in the OidcTrustedDomains.js) where the call has to be authorize using the the authorization Header with Bearer and access Token.
I tried also to display the access token and the access token payload using the useOidcAccessToken
hook but without success.
The hooks useOidcIdToken
and useOidcUser
work as expected.
Versions
- react-oidc: 6.4.0
- nodejs - 18.7.0
- Firefox Developer Edition - 105.0b2
- Microsoft Edge - 104.0.1293.63
- Windows 10 Pro 21H2 - 19044.1889
Screenshots
GET /api/v1/_**edited**_/GetD HTTP/1.1
Host: _**edited**_
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0
Accept: application/json
Accept-Language: en-US,en;q=0.8,de;q=0.5,de-DE;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: http://localhost:5500/
Origin: http://localhost:5500
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
authorization: Bearer ACCESS_TOKEN_SECURED_BY_OIDC_SERVICE_WORKER_default
Connection: keep-alive
Expected
- The API Calls to be authorized
- To have access to the
accessTokenPayload
Actual
- The API calls receive Error 401
accessTokenPayload
returnsnull
Issue Analytics
- State:
- Created a year ago
- Comments:31 (27 by maintainers)
Top Results From Across the Web
Issues · AxaGuilDEv/react-oidc
A set of react components to make Oidc (Open ID Connect) client easy. It aim to simplify OAuth authentication between multiples providers. Compatible...
Read more >axa-fr/react-oidc
With the use of Service Worker, your tokens (refresh_token and access_token) are not accessible to the JavaScript client code (big protection ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @radu-cs ,thank you very much! I am quite busy this week. I will take a look as soon as i can.
Yes all is the same. We’ll get back to investigating it in ~2 weeks. Thank you once again and have a nice weekend! 🙂