Coder Social home page Coder Social logo

uaa's Introduction

User Authentication Authorization Service

Getting started

Enable Authorization Server

@SpringBootApplication
@EnableAuthorizationServer

Application files

see application.yml, schema.sql and data.sql files

cURL test

Grant Type: client_credentials

curl -s -X POST -u "app-mobile:app-mobile123" -d "grant_type=client_credentials" localhost:9191/oauth/token | pjson

Grant Type: password

curl -s -X POST -u 'app-mobile:app-mobile123' 'localhost:9191/oauth/token?grant_type=password&username=jane-doe&password=jane-doe123&scope=READ' | pjson

Refresh Token

curl -X POST -u "app-mobile:app-mobile123" -d "grant_type=refresh_token&refresh_token=438fa86b-9174-4ae6-a8fe-faa9981955f3" http://localhost:9191/oauth/token

Check Token

curl -s -u 'app-mobile:app-mobile123' 'localhost:9191/oauth/check_token?token=ecc66471-0508-4855-adf4-4238559b0921' | pjson

Key Store File Generation

First we need to generate a KeyStore file. To do that execute the command bellow. The command will generate a file called jwt.jks which contains the Public and Private keys.

keytool -genkeypair -alias jwt -keyalg RSA -keypass password -keystore jwt.jks -storepass password

It’s recommended to migrate do PKCS12. To do that execute the following commnad:

keytool -importkeystore -srckeystore jwt.jks -destkeystore jwt.jks -deststoretype pkcs12

Now export the public key and copy the jwt.jks to the resources folder.

keytool -list -rfc --keystore jwt.jks | openssl x509 -inform pem -pubkey

Copy from (including) ----- BEGIN PUBLIC KEY ----- to (including) ----- END PUBLIC KEY ----- and save it in a file. You’ll need this later in your resource servers.

uaa's People

Contributors

wanderleisouza avatar

Watchers

James Cloos avatar  avatar

Forkers

joaovitorsramos

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.