Code Monkey home page Code Monkey logo

okta-spring-boot-authz-server-example's Introduction

Spring Security OAuth 2.0 Guide

This example shows how to create a Authorization Server with Spring Security and OAuth 2.0.

Please read A Quick Guide to OAuth 2.0 with Spring Security for a tutorial that shows you how to build the applications in this repo.

Prerequisites: Java 8 or 11.

Okta has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage and secure users and roles in any application.

Getting Started

To install this example application, run the following commands:

git clone https://github.com/oktadeveloper/okta-spring-boot-authz-server-example.git
cd okta-spring-boot-authz-server-example

Create an Okta Developer Account

If you don't have one, create an Okta Developer account. After you've completed the setup process, log in to your account and navigate to Applications > Add Application. Click Web and Next. On the next page, enter a name for your app (e.g., "Okta OAuth Client"), then click Done.

Update the OktaOAuthClient/src/main/resources/application.yml to have your new app's settings:

okta:
  oauth2:
    issuer: https://{yourOktaDomain}/oauth2/default
    client-id: {yourClientId}
    client-secret: {yourClientSecret}

Start the OktaOAuthClient app using Gradle.

cd OktaOAuthClient
./gradlew bootRun

After everything starts, you should be able to log in with your credentials at http://localhost:8080.

Links

This example uses the following open source projects:

Help

Please post any questions as comments on this repo's blog post, or visit our Okta Developer Forums.

License

Apache 2.0, see LICENSE.

okta-spring-boot-authz-server-example's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

okta-spring-boot-authz-server-example's Issues

configuration in application.yml in auth server

According to link oauth2login-boot-property-mappings, the folllowing configuration in application.yml:
redirect-uri-template: http://localhost:8082/login/oauth2/code/
should be:
redirect-uri: http://localhost:8082/login/oauth2/code/
see: config file

versions may be related:
spring-boot-starter-security-2.2.6.RELEASE.jar
spring-security-oauth2-autoconfigure-2.2.6.RELEASE.jar
spring-security-oauth2-core-5.2.2.RELEASE.jar

Application failed to start at client

I followed your process but facing an issue at the client application it's failed to start


APPLICATION FAILED TO START


Description:

Method springSecurityFilterChain in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration required a bean of type 'org.springframework.security.oauth2.client.registration.ClientRegistrationRepository' that could not be found.

The following candidates were found but could not be injected:
- Bean method 'clientRegistrationRepository' in 'OAuth2ClientRegistrationRepositoryConfiguration' not loaded because OAuth2 Clients Configured Condition registered clients is not available

Action:

Consider revisiting the entries above or defining a bean of type 'org.springframework.security.oauth2.client.registration.ClientRegistrationRepository' in your configuration.

Process finished with exit code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.