All Projects → oktadev → okta-jhipster-microservices-oauth-example

oktadev / okta-jhipster-microservices-oauth-example

Licence: Apache-2.0 license
A microservices architecture built with JHipster, OAuth 2.0, and Okta

Programming Languages

java
68154 projects - #9 most used programming language
typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to okta-jhipster-microservices-oauth-example

Diber-backend
Delivery Service - Spring Boot / Spring Data Jpa / Hibernate / PostgreSQL / OAuth2 Application
Stars: ✭ 22 (-24.14%)
Mutual labels:  oauth, spring-security, spring-security-oauth2
okta-spring-security-5-example
Authentication with Spring Security 5 and Okta OIDC
Stars: ✭ 16 (-44.83%)
Mutual labels:  spring-security, oidc, okta
okta-microservice-security-examples
Demos from Oktane18: API and Microservices Best Practices
Stars: ✭ 17 (-41.38%)
Mutual labels:  oauth, microservices-architecture, okta
casdoor
An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS, QQ group: 645200447
Stars: ✭ 4,147 (+14200%)
Mutual labels:  oauth, oidc
Oauthlib
A generic, spec-compliant, thorough implementation of the OAuth request-signing logic
Stars: ✭ 2,323 (+7910.34%)
Mutual labels:  oauth, oidc
Authlib
The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
Stars: ✭ 2,854 (+9741.38%)
Mutual labels:  oauth, oidc
Sample Spring Oauth2 Microservices
some examples that show basic and more advanced implementations of oauth2 authorization mechanism in spring-cloud microservices environment
Stars: ✭ 109 (+275.86%)
Mutual labels:  oauth, spring-security
oidc
Easy to use OpenID Connect client and server library written for Go and certified by the OpenID Foundation
Stars: ✭ 475 (+1537.93%)
Mutual labels:  oauth, oidc
Oauth2-Stateless-Authentication-with-Spring-and-JWT-Token
Oauth2 Stateless Authentication with Spring and JWT Token
Stars: ✭ 108 (+272.41%)
Mutual labels:  spring-security, spring-security-oauth2
casdoor-go-sdk
Go client SDK for Casdoor
Stars: ✭ 37 (+27.59%)
Mutual labels:  oauth, oidc
okta-react-native-spring-boot-example
React Native + Spring Boot + OIDC
Stars: ✭ 24 (-17.24%)
Mutual labels:  jhipster, oidc
kubernetes-localdev
Create a local Kubernetes development environment on macOS or Windows and WSL2, including HTTPS/TLS and OAuth2/OIDC authentication.
Stars: ✭ 210 (+624.14%)
Mutual labels:  oauth, oidc
Pac4j
Security engine for Java (authentication, authorization, multi frameworks): OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 2,097 (+7131.03%)
Mutual labels:  oauth, 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 (+40879.31%)
Mutual labels:  oauth, oidc
Spring Security Pac4j
pac4j security library for Spring Security: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 231 (+696.55%)
Mutual labels:  oauth, spring-security
Spring Security Oauth
Just Announced - "Learn Spring Security OAuth":
Stars: ✭ 1,649 (+5586.21%)
Mutual labels:  oauth, spring-security
springboot-vue.js-bbs
Spring Boot, Vue.js
Stars: ✭ 43 (+48.28%)
Mutual labels:  spring-security, spring-security-oauth2
Next Auth
Authentication for Next.js
Stars: ✭ 8,362 (+28734.48%)
Mutual labels:  oauth, oidc
Short
URL shortening service written in Go and React
Stars: ✭ 777 (+2579.31%)
Mutual labels:  oauth, microservices-architecture
keycloak-springsecurity5-sample
Spring Security 5 OAuth2 Client/OIDC integration with Keycloak sample
Stars: ✭ 55 (+89.66%)
Mutual labels:  spring-security, oidc

Hip Microservices with JHipster and OAuth

This example shows how to create a microservices architecture with JHipster and secure it using Okta.

Please read Develop a Microservices Architecture with OAuth 2.0 and JHipster for a tutorial that shows you how to build this application.

Prerequisites: Java 8, Node.js, and Docker.

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-jhipster-microservices-oauth-example.git
cd okta-jhipster-microservices-oauth-example

This will get a copy of the project installed locally. To build all the projects as Docker images, run the following command in the gateway, blog, and store directories:

./mvnw package -Pprod -DskipTests jib:dockerBuild

JHipster ships with Keycloak configured for OAuth by default. To configure your apps to work with Okta, you'll first need to create a free developer account. After doing so, you'll get your own Okta domain, that has a name like https://dev-123456.oktapreview.com.

Create an OIDC Application on Okta

Create an OIDC App in Okta to get a client ID and secret. This basically means you're "registering" your application with Okta. Log in to your Okta Developer account and navigate to Applications > Add Application. Click Web and click the Next button. Give the app a name you’ll remember (e.g., JHipster Microservices), and specify http://localhost:8080 as a Base URI and http://localhost:8080/login as a Login Redirect URI. Click Done and make note of your client ID and client secret values.

In order for the roles coming from Okta to match the default roles in JHipster, you'll need to create them. Create a ROLE_ADMIN and ROLE_USER group (Users > Groups > Add Group) and add users to them. You can use the account you signed up with, or create a new user (Users > Add Person). Navigate to API > Authorization Servers, click the Authorization Servers tab and edit the default one. Click the Claims tab and Add Claim. Name it roles, and include it in the ID Token. Set the value type to Groups and set the filter to be a Regex of .*.

Set the values for your Okta authorization server, client ID, and client secret as environment variables.

export SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI="https://{yourOktaDomain}.com/oauth2/default/v1/token"
export SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI="https://{yourOktaDomain}.com/oauth2/default/v1/authorize"
export SECURITY_OAUTH2_RESOURCE_USER_INFO_URI="https://{yourOktaDomain}.com/oauth2/default/v1/userinfo"
export SECURITY_OAUTH2_RESOURCE_TOKEN_INFO_URI="https://{yourOktaDomain}.com/oauth2/default/v1/introspect"
export SECURITY_OAUTH2_CLIENT_CLIENT_ID="{clientId}"
export SECURITY_OAUTH2_CLIENT_CLIENT_SECRET="{clientSecret}"

Then cd into the docker-compose directory and run:

docker-compose up -d

It can take a while to start all 14 containers, so now might be a good time to take a break, or go on a run. You can use Docker's Kitematic to watch the status of your images as they start. After all your containers are running, you should be able to log in with your credentials at http://localhost:8080.

Links

This example uses the following libraries provided by open source:

Help

Please post any questions as comments on the blog post, or visit our Okta Developer Forums. You can also email [email protected] if 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].