Closed RewardRepo closed 4 years ago
Hi, Mattia. How are you?
You will not use [your] login form.
Following the readme you will get a "login URL" which will redirect the user to Keycloak login page.
Hi Matio,
Thanks for the response! Yes, sorry We have the login form in our keycloack server but I don't know how to redirect the authentication.
Thanks, Mattia
If you protected a route, the user will be redirected to login.
If you want the link to login (or another page) just use: route('keycloak.login');
.
I hope this can help you.
Hi,
I'm currently trying to implement the package, but after I login I'm encountering and error. It redirects me too many times. What do you think is the issue?
Thank you for the amazing package!
@rickcwlng-hc I moved your comment to a new issue. Let's work there, ok? :)
Thanks for the response. Last question, how can I retrive the user information when I come back from the login form? Our server response is a JWT.
Thanks, Mattia
You don't need to do this.
This package take care of persist session and you can use the Auth Guard methods like regular laravel login.
Anyway, you can use the Vizir\KeycloakWebGuard\Facades\KeycloakWeb
facade and retrieveToken
method.
Using KeycloakWeb::retrieveToken(); or Auth::user() the result is always null
So, token was not stored on session.
Check Keycloak is redirecting to callback after login, please.
Hi,
yes, in url I have "redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fcallback."
In function retrieveToken() I have the correct token but the return of the function is null
I resolved the issue:
I changed the SESSION_DRIVER from "cookie" to "native"
Hi. There's no "native" SESSION_DRIVER.
Maybe, using "native" (which is invalid) Laravel uses "file" driver.
I'll check it's all OK with "cookie" session, but it's recommended to use "file" anyway because will work well for the majority of applications.
Closing because sounds like everything is OK.
If you have any problem, please not hesitate to create a new issue.
Thanks.
Hi,
I have some problem to configure the framework. How can I configure the login form?
I follow you readme but now I don't know how to authenticate the user.
Thanks Mattia