Closed lyio closed 4 months ago
Yes, it is possible but can you explain your use case?
I am porting an old Cordova App to Flutter and stumbled across the responseMode
. And then I misinterpreted this line from the Keycloak documentation "Universal Links on iOS seem to work more reliably with response-mode set to query". But that refers to Cordova Apps.
My actual problem was the redirectUri
. The server does not seem to accept the bundle.id://login-callback
URI. But I assume that needs to be configured in Keycloak. The server accepts localhost
as is the default in keycloak.js. That is not a supported value for actual Apps, is it?
I didn't configure the responseMode
inside this package, but the default value should be query
.
But if you really need it, I can add the configuration for that particular value. Maybe I can create a new branch for that; is that okay?
Hey @lyio
I've made a branch for you to configure the responseMode
by yourself. Just import the package inside your pubspec.yaml like this
keycloak_wrapper:
git:
url: https://github.com/fa-fifi/keycloak_wrapper.git
ref: response-mode
Then you can set your own responseMode
inside KeycloakConfig
. Please let me know if this resolves your problem. If not, then I'll try to find another way.
@fa-fifi thank you for your work. My problem has been resolved by me reading the documentation and getting the backend team to reconfigure Keycloak :) Thank you again.
But a different question, when I am using the accessToken
to authenticate API calls, and the token expires, how do I make keycloak_wrapper
refresh the token? Calling login again is probably not the correct way to go about that.
I guess, the confusion stems from the fact that I don't see how the keycloak_wrapper
would know that the token expired and that it needs to refresh the token.
It's great to hear your issue has been resolved. 👍
Regarding your question, unfortunately, you're right. I built this package for my app, where the token expiration is checked on the server side not the client side, that's why this package didn't have that particular functions.
But I think it's a good idea to add these features for those who need them.
I will try to add these features asap, but in the meantime, do you encounter any other issues?
Thank you for the quick responses. No, I have not encountered any other issues so far.
Is it possible to add configuration for the
responseMode: query
?