Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue With Authentication with FROST Server #1897

Open
ParidV opened this issue Mar 11, 2024 · 1 comment
Open

Issue With Authentication with FROST Server #1897

ParidV opened this issue Mar 11, 2024 · 1 comment

Comments

@ParidV
Copy link

ParidV commented Mar 11, 2024

To access FROST Data, users need to have a valid token and that token can be used to Store/Update/Fetch data from FROST.
The issue is that the token that is retrieved from Frontend (Keycloak.js library) and then used in requests is not valid to access and to manipulate the FROST data. It gives an error: 401 - Unauthorized.

The frontend and FROST Server are running on different domains, The frontend is running on HTTPS, and the FROST Server is running on HTTP.

If you make a request in Postman to fetch the token of the user via Keycloak endpoint, and if you use that token to access frost data it is valid.

When both the frontend and FROST servers were on the same domain on Tuzehez, the functionality of the token to access data was valid.

Library Versions on Frontend:

react-keycloak/web": "3.4.0",
keycloak-js:21.0.1
@hylkevds
Copy link
Member

If it works from Postman then the problem is probably on the client side. If the front end is running on a different domain it is likely a CORS problem.
Make sure you have the front end domain listed in the allowed origins, as '*' is not allowed when using authentication.
Check the debugger of your browser to see what exactly is being sent to FROST, and compare that to what is being sent by Postman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants