All Projects → oktadev → okta-spring-security-5-example

oktadev / okta-spring-security-5-example

Licence: Apache-2.0 license
Authentication with Spring Security 5 and Okta OIDC

Programming Languages

java
68154 projects - #9 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to okta-spring-security-5-example

okta-jhipster-microservices-oauth-example
A microservices architecture built with JHipster, OAuth 2.0, and Okta
Stars: ✭ 29 (+81.25%)
Mutual labels:  spring-security, oidc, okta
schematics
Schematics for adding Okta Auth to your projects
Stars: ✭ 60 (+275%)
Mutual labels:  oauth2, oidc, okta
native-java-examples
Native Java Apps with Micronaut, Quarkus, and Spring Boot
Stars: ✭ 44 (+175%)
Mutual labels:  oauth2, oidc
Company Structure Spring Security Oauth2 Authorities
Example Spring Boot + Spring Security+ OAuth2 project for demonstration purposes.
Stars: ✭ 172 (+975%)
Mutual labels:  oauth2, spring-security
Oauthlib
A generic, spec-compliant, thorough implementation of the OAuth request-signing logic
Stars: ✭ 2,323 (+14418.75%)
Mutual labels:  oauth2, oidc
omniauth-okta
OAuth2 strategy for Okta
Stars: ✭ 29 (+81.25%)
Mutual labels:  oauth2, okta
Node Oidc Provider
OpenID Certified™ OAuth 2.0 Authorization Server implementation for Node.js
Stars: ✭ 2,018 (+12512.5%)
Mutual labels:  oauth2, oidc
Oauth2 Family Barrel
OAuth2全家桶项目。本项目演示了如何使用spring-boot、spring-security以及spring-security-oauth快速构建OAuth2服务框架体系。
Stars: ✭ 188 (+1075%)
Mutual labels:  oauth2, spring-security
Spring Boot Angular Template
Starter Template to create a OAuth2 secured dockerized Spring Boot 2 Application with Angular 8 Frontend
Stars: ✭ 48 (+200%)
Mutual labels:  oauth2, spring-security
keycloak-springsecurity5-sample
Spring Security 5 OAuth2 Client/OIDC integration with Keycloak sample
Stars: ✭ 55 (+243.75%)
Mutual labels:  spring-security, oidc
okta-spring-boot-saml-example
Spring Boot, SAML, and Okta
Stars: ✭ 52 (+225%)
Mutual labels:  spring-security, okta
Sample Spring Oauth2 Microservices
some examples that show basic and more advanced implementations of oauth2 authorization mechanism in spring-cloud microservices environment
Stars: ✭ 109 (+581.25%)
Mutual labels:  oauth2, spring-security
Reactive Spring Security 5 Workshop
Hands-On workshop for securing a reactive spring boot 2 application in multiple steps
Stars: ✭ 92 (+475%)
Mutual labels:  oauth2, spring-security
Hydra
OpenID Certified™ OpenID Connect and OAuth Provider written in Go - cloud native, security-first, open source API security for your infrastructure. SDKs for any language. Compatible with MITREid.
Stars: ✭ 11,884 (+74175%)
Mutual labels:  oauth2, oidc
Easy Notes
🍋 简笔记(easy notes)打造你的轻便私人笔记。接口涉及Spring Security、OAuth2、Jwt、MongoDB,客户端采用 Vue.js 、Ant Design
Stars: ✭ 89 (+456.25%)
Mutual labels:  oauth2, spring-security
Mcloud
基于Spring Cloud,实现微服务中常用的基础模块,包括 OAuth2 认证服务,统一注册中心,系统监控中心, 统一配置中心,API网关以及熔断器
Stars: ✭ 185 (+1056.25%)
Mutual labels:  oauth2, spring-security
Oauth2 Shiro Jwt
use oauth2, shiro and spring specrity to make an ums system
Stars: ✭ 29 (+81.25%)
Mutual labels:  oauth2, spring-security
Oidc Workshop Spring Io 2019
Workshop at Spring I/O 2019 on "Securing Microservices with OpenID Connect and Spring Security 5.1"
Stars: ✭ 43 (+168.75%)
Mutual labels:  oauth2, spring-security
Authlib
The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
Stars: ✭ 2,854 (+17737.5%)
Mutual labels:  oauth2, oidc
fastapi-azure-auth
Easy and secure implementation of Azure AD for your FastAPI APIs 🔒 B2C, single- and multi-tenant support.
Stars: ✭ 174 (+987.5%)
Mutual labels:  oauth2, oidc

Spring Security 5 + Okta

An example app that shows how to use OIDC with Spring Security 5 and Okta.

Please read Get Started with Spring Security 5.0 and OIDC to see how this app was created.

Prerequisites: Java 8.

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-security-5-example.git
cd okta-spring-security-5-example

This will get a copy of the project installed locally. To install all of its dependencies and start the app, run:

./mvnw spring-boot:run

Create an Application in Okta

You will need to create an OpenID Connect Application in Okta to get your values to perform authentication.

Log in to your Okta Developer account (or sign up if you don’t have an account) and navigate to Applications > Add Application. Click Web, click Next, and give the app a name you’ll remember. Click Done and copy the clientId and clientSecret into server/src/main/resources/application.yml.

spring:
  thymeleaf:
    cache: false
  security:
    oauth2:
      client:
        registration:
          okta:
            client-id: {clientId}
            client-secret: {clientSecret}
        provider:
          okta:
            authorization-uri: https://{yourOktaDomain}.com/oauth2/default/v1/authorize
            token-uri: https://{yourOktaDomain}.com/oauth2/default/v1/token
            user-info-uri: https://{yourOktaDomain}.com/oauth2/default/v1/userinfo
            jwk-set-uri: https://{yourOktaDomain}.com/oauth2/default/v1/keys

NOTE: The value of {yourOktaDomain} should be something like dev-123456.oktapreview. Make sure you don't include -admin in the value!

After modifying this file, restart your app and you'll be prompted to click on an "Okta" link to log in.

Links

This example uses Spring Security's OAuth 2.0 Login feature.

Help

Please post any questions as comments on the blog post, or visit our Okta Developer Forums. You can also email [email protected] if you would like to create a support ticket.

License

Apache 2.0, see LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].