Hello! I am encountering the problem: "clientRegistrationRepository cannot be null". I'm pretty sure that the application.properties is allright. Don't you know, what could possibly cause this problem?
Nice Video brother...but i have a Question. In a multi tenant environment how do you set the provider url knowing that the provider url consist of a realm name and each tenant has its own realm
You can create a new provider under the same property for the first provider. Just have to give a new provider name.. In the my github repo for the gateway, just duplicate the provider and give a new provider name and provide a new url.
i found a way using ClientRegistrationRepository availble at docs.spring.io/spring-security/site/docs/5.2.12.RELEASE/reference/html/oauth2.html#oauth2login-register-clientregistrationrepository-bean
You can add multiple tenants in the gateway by specifying them in the properties file.. But at runtime I am not sure about it.. and highly doubt it that it can done at runtime..
How do you call one resource rest service via spring gateway from the front end angular client without getting cors preflight error on the browser? Eg - I have an angular front end client on 4200 port with keycloak login. Also have an spring cloud gateway on 8081 with keycloak setup (different keycloak client) and sample demo rest endpoint service on 9092. When I am trying to access my rest end point from front end client I am getting an cors preflight error. Do you have any suggestions on how to overcome that?
If you are running it locally, you can just disable cors.. or else you will have to configure the cors to allow localhost as one of the allowed domains.. you could search for how to configre cors with allowed domains..
When people record videos on something, if they do now start telling about what problem that something solves, it is annoying. What problem does this mode of usage of the components solve?
@Refactor First I followed your tutorial, it's seems good but the problem is whenever I try to get token first using keycloak token API and then I put it in Request Header as Bearer then he is asking for username & password in Keycloak login page. How to skip this logically if I'm having access token then I should get direct access to API. I'm accessing the token API and gateway API through POSTMAN
If you are accessing the api through the gateway with the access token using the authorization header as Bearer accesstoken, then it should work.. you should not get redirected to the login page, if the token is valid and not expired.
excellent ! the way of explanation is superb and ownsome , I never see a TH-cam channel like this 💯
This and part 2 are golden! Best representations about covered topics I've seen!
Man, great Thanks. From Russia with code🤝.
nice tutorial, keep posting such nice stuff.
Really nice walkthrough, very helpful. Thanks!
Thanks a lot for your kind words.. will be making more videos like this..
Excellent! Exactly what I needed.
One Q - How do you get the user information using that ID after login?
great tutorial mahn...simple and easy to follow..
Thank you
Well done brother haven't seen such a clear explanation in any other tutorial. Keep posting good stuff.....
Awesome video. Thanks.
Hello! I am encountering the problem: "clientRegistrationRepository cannot be null". I'm pretty sure that the application.properties is allright. Don't you know, what could possibly cause this problem?
Cool tutorial, but is there any way to enable policy enforcer for fine grained authorization?
Nice tutorials. However, How do we do without the redirect login page as I’m building an api that doesn’t require any login page
Nice Video brother...but i have a Question. In a multi tenant environment how do you set the provider url knowing that the provider url consist of a realm name and each tenant has its own realm
You can create a new provider under the same property for the first provider. Just have to give a new provider name.. In the my github repo for the gateway, just duplicate the provider and give a new provider name and provide a new url.
that's a way to go but in my case i may need to add a tenant on runtime i.e create a new keycloak realm
i found a way using ClientRegistrationRepository availble at docs.spring.io/spring-security/site/docs/5.2.12.RELEASE/reference/html/oauth2.html#oauth2login-register-clientregistrationrepository-bean
How about handling multiple tenants in spring cloud gateway...Is there a way to add oauth2 clients at runtime
You can add multiple tenants in the gateway by specifying them in the properties file.. But at runtime I am not sure about it.. and highly doubt it that it can done at runtime..
Please i am getting error creating bean with name spring security filter chain throws no class def found error .. Can you please help out.. Thanks
It would be a bit difficult to know which dependency it is.. try downloading my code from github and checking it ..
Thanks.. Can you please make a video using like angular as the frontend not necessary the keycloak theme
Will try to if I can.. :)
how to make custom Login endpoint for Keycloak? So that I can login to the system using Postman
How do you call one resource rest service via spring gateway from the front end angular client without getting cors preflight error on the browser?
Eg - I have an angular front end client on 4200 port with keycloak login. Also have an spring cloud gateway on 8081 with keycloak setup (different keycloak client) and sample demo rest endpoint service on 9092. When I am trying to access my rest end point from front end client I am getting an cors preflight error. Do you have any suggestions on how to overcome that?
If you are running it locally, you can just disable cors.. or else you will have to configure the cors to allow localhost as one of the allowed domains.. you could search for how to configre cors with allowed domains..
When people record videos on something, if they do now start telling about what problem that something solves, it is annoying. What problem does this mode of usage of the components solve?
@Refactor First I followed your tutorial, it's seems good but the problem is whenever I try to get token first using keycloak token API and then I put it in Request Header as Bearer then he is asking for username & password in Keycloak login page. How to skip this logically if I'm having access token then I should get direct access to API. I'm accessing the token API and gateway API through POSTMAN
If you are accessing the api through the gateway with the access token using the authorization header as Bearer accesstoken, then it should work.. you should not get redirected to the login page, if the token is valid and not expired.