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

[SDK-4652] Spring Boot Login - Use Spring Boot 3 and Okta Spring Boot Starter #10323

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

jimmyjames
Copy link
Contributor

Changes

Updates the quickstart to use latest Spring Boot and the Okta Spring Boot Starter.

This change accompanies auth0-samples/auth0-spring-boot-login-samples#21

okta:
oauth2:
issuer: https://${account.namespace}/
client-id: ${account.clientId}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these variables that are replaced? Otherwise, the syntax looks funny.

Copy link
Member

@frederikprijck frederikprijck Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes account.namespace becomes the domain, and account.clientId the corresponding clientId based on the selected application when logged in in the docs platform. When not logged in, these gets replaced by placeholders.

For example, see the already existing quickstart for spring-boot: https://github.com/auth0/docs/blob/master/articles/quickstart/webapp/java-spring-boot/files/application.md

When not logged in, these become:

spring:
  security:
    oauth2:
      client:
        registration:
          auth0:
            client-id: {yourClientId}
            client-secret: YOUR_CLIENT_SECRET
            scope:
              - openid
              - profile
              - email
        provider:
          auth0:
            # trailing slash is important!
            issuer-uri: https://{yourDomain}/

While when logged in, they reflect actual values. This allows to easily copy paste the config when being logged in to the docs platform, while avoiding the weird syntax when not being logged in (because yeah, the syntax is not something that makes sense for our users, but it should also be something our users won't ever see)

As you can see, it's a bit different for the secret, as we don't ever prefill secrets afaik.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mraible yes, they are replaced when a user logs in and downloads the sample.

frederikprijck
frederikprijck previously approved these changes Oct 24, 2023
poovamraj
poovamraj previously approved these changes Oct 24, 2023
@jimmyjames jimmyjames dismissed stale reviews from poovamraj and frederikprijck via 08b442c October 24, 2023 16:55
Co-authored-by: Matt Raible <matt@raibledesigns.com>
@jimmyjames jimmyjames merged commit 83976fd into master Oct 26, 2023
2 checks passed
@jimmyjames jimmyjames deleted the update-spring-boot-login-qs branch October 26, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants