Coder Social home page Coder Social logo

azurecloudmonk / okta-netty-webflux-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oktadev/okta-netty-webflux-example

0.0 1.0 0.0 78 KB

Tutorial: Create a Netty application with and without Spring

Home Page: https://developer.okta.com/blog/2019/11/25/java-netty-webflux

Java 100.00%

okta-netty-webflux-example's Introduction

Netty Example

This example app shows how to create a Netty application with and without Spring and then add OAuth 2.0/OIDC support.

To see how this example was created, please read A Quick Guide to Java on Netty.

Prerequisites:

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-netty-webflux-example.git okta-netty-webflux-example
cd okta-netty-webflux-example/webflux-oauth2login

This will get a copy of the project installed locally.

Create a Free Okta Developer Account

If you don't have one, create an Okta Developer account. After you've completed the setup process, you'll need to log in and create a new application.

  • Go to Applications > Add Application
  • Select Web and click Next
  • Fill in the following options in the form:
    • Name: Bootiful Kafka
    • Base URIs: http://localhost:8080
    • Login redirect URLs: http://localhost:8080/login/oauth2/code/okta
  • Click Done

Copy and paste your client ID and secret into src/main/resources/application.properties.

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

The value for {yourOktaDomain} can be found in the top right corner of your Okta Dashboard, it will look something like: https://dev-123456.okta.com.

IMPORTANT: This file should only be used locally. Do not commit your client's secret to Git or any other Version Control System.

To avoid accidentally exposing these credentials, you can also specify your Okta application's values as environment variables. Create an okta.env file in the root directory of your app with the following environment variables. Then run source okta.env before starting your app.

export OKTA_OAUTH2_ISSUER=https://{yourOktaDomain}/oauth2/default
export OKTA_OAUTH2_CLIENT_ID={yourClientID}
export OKTA_OAUTH2_CLIENT_SECRET={yourClientSecret}

Start the application

To start the application you can run:

./gradlew run

Navigate to http://localhost:8080 to authenticate with Okta! If you don't see a login screen, it's likely because you're already logged in. Try it in an incognito window to see the OAuth 2.0 code flow in action.

Links

This example uses the following libraries provided by Okta:

Help

Please post any questions as comments on this 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.

okta-netty-webflux-example's People

Contributors

moksamedia avatar bdemers avatar

Watchers

 avatar

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.