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

(Not a bug) Really excellent work! #22

Open
teuber789 opened this issue Jul 7, 2021 · 8 comments
Open

(Not a bug) Really excellent work! #22

teuber789 opened this issue Jul 7, 2021 · 8 comments
Assignees
Labels
kudos Notify me this project is useful and you'd like me to keep it up to date

Comments

@teuber789
Copy link

I happened upon this repo while looking for a way to mock Keycloak tokens in Spring MVC controller tests. Your WithMockKeycloakAuth annotation worked like a charm and saved me a ton of hassle. Just wanted to post a little note saying thanks again and keep up the good work!

(This isn't exactly a bug...but I wasn't sure where else to put it :/ )

@ch4mpy
Copy link
Owner

ch4mpy commented Jul 15, 2021

@teuber789 much appreciated. Thanks.

If you like the libs, please consider giving a star. Same for the people you work with.

Seams stupid, but reaching 150 stars could open the door to publishing on Baeldung and greatly widen users community.

@ch4mpy ch4mpy added the kudos Notify me this project is useful and you'd like me to keep it up to date label Jul 15, 2021
@ch4mpy ch4mpy self-assigned this Jul 15, 2021
@razeelmohammed
Copy link

The Spring Boot 3 Keyclock examples are a real life saver. Good work team.

Repository owner deleted a comment from fintans Oct 25, 2022
@lArtiquel
Copy link
Contributor

@ch4mpy I agree that this stuff should be on Baeldung already. I found it by accident after also accidentally finding that the Keycloak adapters are now deprecated and after hours of writing crutch configurations with Spring OAuth2. And I think there are more people like me who found this solution by accident. Anyway, thanks for sharing your solution!

@ch4mpy
Copy link
Owner

ch4mpy commented Feb 15, 2023

@lArtiquel it is a work in progress. Baeldung required 150 popularity (stars plus forks) before I could submit articles about this libs and I reached it last month.

I have submitted a tutorial about mocking OAuth2 identities during tests which is in review (this a rather long process with pretty strict editorial rules I have to learn and comply with).

I hope one about portable resource-server configuration will follow.

@JonasMArnold
Copy link

Gave this one a star as well! Saved me a lot of pain in many regards.

Thanks @ch4mpy for this great repository as well as your active StackOverflow presence!

@ch4mpy
Copy link
Owner

ch4mpy commented Jul 10, 2023

@JonasMArnold thank you for the positive feedback, it is always pleasant to read.

I was pretty busy at that moment with two major upgrades:

  • load test claim-sets from JSON files and build test Authentication using the converter found in test configuration
  • merge all Spring Boot starters into a single one and refresh properties structure

Please make sure you give those two a try, I'm sure it is worth the effort.

@Makintos
Copy link

Makintos commented Nov 5, 2023

Another star! Thank you @ch4mpy

One question: BFF + multitenant dynamic, is it possible?

spring:
  security:
    oauth2:
      client:
        provider:
          keycloak:
            issuer-uri: ${issuer}
            user-name-attribute: ${user-name-attribute}
        registration:
          keycloak:
            provider: keycloak
            client-id: ${client-id}
            client-secret: ${client-secret}
            authorization-grant-type: authorization_code
            scope:
            - openid
            - profile
            - email
            - offline_access
            - roles

@ch4mpy
Copy link
Owner

ch4mpy commented Nov 5, 2023

Configuration properties as you define in your yaml are "static". Spring-addons can hardly produce "dynamic" configuration from it.

What you might consider is spinning a BFF instance for each of your tenant: when you add a tenant, you probably have declared a dedicated OAuth2 client in your authorization server for it and should be able to generate the Spring configuration yaml for a new BFF instance dedicated to this new tenant. Each BFF would be a "static" single-tenant OAuth2 client with a single login option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kudos Notify me this project is useful and you'd like me to keep it up to date
Projects
None yet
Development

No branches or pull requests

6 participants