Microservices Authentication & Authorization
  • README
  • Introduction
    • Requirements and Setup
    • Sample Application Architecture
  • Intro Labs
    • Authorization Grant Flows in Action
    • Authorization Code Grant Demo
  • Hands-On Labs
    • Lab 1: Resource Server
    • Lab 2: Testing the Resource Server
    • Lab 3: Call another Microservice
Powered by GitBook
On this page
  • Requirements
  • IntelliJ
  • Eclipse IDE
  • Visual Studio Code
  • Get the source code
  • Run the java applications
  • Setup Spring Authorization Server
  • Check Running Server
  • Further Information
  1. Introduction

Requirements and Setup

PreviousREADMENextSample Application Architecture

Last updated 2 years ago

Requirements

  • Version 11 or 17

  • A Java IDE like

  • , , or for REST calls

In case you select , then the provided might be helpful. Just import this into Postman.

IntelliJ

IntelliJ does not require any specific additional plugins or configuration.

Eclipse IDE

If you are an Eclipse user, then the usage of the Eclipse-based is strongly recommended. This eclipse variant already has all the required gradle and spring boot support pre-installed.

In case you want to stick to your plain Eclipse installation then you have to add the following features via the eclipse marketplace:

  • BuildShip Gradle Integration (Version 3.x). This might be already pre-installed depending on your eclipse variant (e.g. Eclipse JavaEE) installed.

  • Spring Tools 4 for Spring Boot (Spring Tool Suite 4).

Visual Studio Code

To be able to work properly in Visual Studio Code with this Spring Boot Java Gradle project you need at least these extensions:

  • Java Extension Pack

  • vscode-gradle-language

  • VS Code Spring Boot Application Development Extension Pack

Get the source code

git clone https://github.com/andifalk/microservices-auth-authz-spring-security.git workshop

After that you can import the whole workshop project directory into your IDE as a gradle project:

Run the java applications

All spring boot based java projects can either be run using your Java IDE or using the command line with changing into the corresponding project directory and issuing a ./gradlew bootRun command.

Setup Spring Authorization Server

To set up and run this project:

  1. Import this project into your IDE as a gradle project

  2. After the IDE has configured the project you can start the authorization server by running the main class com.example.spring.authorizationserver.SpringAuthorizationServerApplication

Check Running Server

The spring authorization server does not have a UI. Instead, to prove it is running just open the web browser and navigate to http://localhost:9000/.well-known/openid-configuration.

Now, if you see the openid configuration in the browser (how nice it is shown depends on your browser addons) then spring authorization server is ready to use it for this workshop.

Further Information

Clone this GitHub repository :

: Open menu item "New project from existing sources..." and then select 'Gradle' when prompted

or : Open menu item "Import/Gradle/Existing gradle project"

: Just open the root directory in VS Code and wait until VS Code has configured the project

In this workshop we will use a customized version of as local identity provider. implements OAuth 2.0 and OpenID Connect 1.0.

You need a compliant OAuth 2.0 / OpenID Connect 1.0 provider for this workshop. Here we will use .

Clone or download the GitHub repository at:

If you want to know more about setting up a spring authorization server for your own projects then please consult the . Please note that currently there is not really much documentation there, but currently the community is adding more docs.

Java SDK
Eclipse
Spring Toolsuite
IntelliJ
Visual Studio Code
Git
Postman
Httpie
Curl
Postman
Postman Collection
Postman Collection (Version 2.1 format)
Spring ToolSuite
https://github.com/andifalk/microservices-auth-authz-spring-security
IntelliJ
Eclipse
Spring ToolSuite
Visual Studio Code
Spring Authorization Server
Spring Authorization Server
Customized Version of Spring Authorization Server
https://github.com/andifalk/custom-spring-authorization-server
spring authorization server GitHub project
Openid Configuration