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

Error when fetching devices: 401 Error from Keycloak: {"error":"invalid_grant","error_description":"Invalid bearer token"} #69

Open
cdupont opened this issue May 23, 2019 · 5 comments
Labels

Comments

@cdupont
Copy link
Contributor

cdupont commented May 23, 2019

It seems the token is wrong on some requests.
Screenshot from 2019-05-23 15-34-34

@cdupont
Copy link
Contributor Author

cdupont commented May 23, 2019

Strangely the token used in the requests seems to not be the good one after login. It is like that:

eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJMbGE5X3BNeFVwc1QxTXpsM2dsdkRFTFZIa256OWZDb191Q3JheDh1dkJ3In0.eyJqdGkiOiJmMzg1MmU1Mi02ZjkwLTQwNWQtODU0ZC1hMDMzYWY5NTcwMGEiLCJleHAiOjE1NTg2MTQ5OTMsIm5iZiI6MCwiaWF0IjoxNTU4NjE0OTMzLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvd2F6aXVwIiwiYXVkIjoiZGFzaGJvYXJkIiwic3ViIjoiMmVjZmFlMjQtZjM0MC00YWQwLWExMmUtMDJjZGM2MGNkOGJhIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZGFzaGJvYXJkIiwibm9uY2UiOiJhMjc3ZTI5Ni04YjExLTRkZjItODUyNi1mYWFkOGY4N2Q5YzkiLCJhdXRoX3RpbWUiOjE1NTg2MTQ5MzMsInNlc3Npb25fc3RhdGUiOiIyNWMzNzExNS1hYTIxLTQxYmUtYjQxZi0yOWM3NWExM2UzZDciLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbIioiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwicmVnaXN0ZXJlZF91c2VyIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZWFsbS1tYW5hZ2VtZW50Ijp7InJvbGVzIjpbInZpZXctdXNlcnMiLCJxdWVyeS1ncm91cHMiLCJxdWVyeS11c2VycyJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQiLCJuYW1lIjoiQ29yZW50aW4gRHVwb250IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2R1cG9udCIsImdpdmVuX25hbWUiOiJDb3JlbnRpbiIsImZhbWlseV9uYW1lIjoiRHVwb250IiwiZW1haWwiOiJjZHVwb250QGZiay5ldSJ9.u7cTb2sH43Trxrp5wwz4iRHPomZTb5dObyyBvCNVWewuhHuZO8gCxv0zVOx0LHXO5AdISnKaBwqVM00OW0AJAf72elRd49F6ouzOTWE14CPf58hESTZ9a8qUEWq-A7mu0jwcJqVpDOKciwwW6AtVK1RiY8oCoIAXI0t40h8f6bMaeyWarZxBkcUxnYgJK-69MR9-A-bBtfr8R2YLeDHUJ1wpMcVVPMcoQQf3dmDSp4QS6fbRmJuyDOYeIysbtTiW_x0ziKB0J7r7aXtVf6FO78Cjris34-HvereRLN5DRU9V0q-FVMN626Cn_XcUyv241BY4sBA__30MwDpCQgSNEw

But the token issued by Keycloak is different:

eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJMbGE5X3BNeFVwc1QxTXpsM2dsdkRFTFZIa256OWZDb191Q3JheDh1dkJ3In0.eyJqdGkiOiIyN2M2MDEzMC1kNmRkLTRlOGQtOWQ4MC03ZWFkZGYyYmVmZWMiLCJleHAiOjE1NTg2MjA5MjMsIm5iZiI6MCwiaWF0IjoxNTU4NjIwODYzLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvd2F6aXVwIiwiYXVkIjoiZGFzaGJvYXJkIiwic3ViIjoiMmVjZmFlMjQtZjM0MC00YWQwLWExMmUtMDJjZGM2MGNkOGJhIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZGFzaGJvYXJkIiwibm9uY2UiOiI2OTdkMDI5OC0zZjZlLTQ1OTUtOWIxYi02NGZmMDFjNTVkZGEiLCJhdXRoX3RpbWUiOjE1NTg2MTg3…YW1lIjoiQ29yZW50aW4gRHVwb250IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2R1cG9udCIsImdpdmVuX25hbWUiOiJDb3JlbnRpbiIsImZhbWlseV9uYW1lIjoiRHVwb250IiwiZW1haWwiOiJjZHVwb250QGZiay5ldSJ9.L0BWHBsk6-LmPDjGJlzgST3OOKHuu54JlZTveROj_bhlI_ziyqwCZjD5kNVn5EELSp7eKjQUKoY9iSEDlKhxrZRjNXipmSVTeJojOlwqC1SrXmlyPl8ou81kk5vTSbr2sxXGxH1kZxC7KBKphHjUUerMEhrbZZ420_3Y15E7MvujX4HRCCSFAkabZmx5dVFjr9E0N03AxRV667zBoKx82Do3o3TDEsvuZld0Jzus5zZglf896G0CPoZM22_GbYQ1Izix-LB0ioh82hPHUh9DN3ZaVT03PShsnhXb84ivQdWnniau-NNTy27n_ljtaRr7jR7gP1hAegIoduC1gwQCWw

Why is it using the wrong token?

@cdupont
Copy link
Contributor Author

cdupont commented May 23, 2019

It seems to use the token from the previous session.

@cdupont
Copy link
Contributor Author

cdupont commented May 23, 2019

Commenting out "autoRehydrate" seems to work: https://github.com/Waziup/waziup-dashboard/blob/master/src/store/index.js#L10

@cdupont
Copy link
Contributor Author

cdupont commented Jun 3, 2019

Fixed by blacklisting keycloak in store

@cdupont cdupont closed this as completed Jun 3, 2019
@cdupont
Copy link
Contributor Author

cdupont commented Sep 26, 2019

The message reappears now.

@cdupont cdupont reopened this Sep 26, 2019
@cdupont cdupont added the bug label Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant