All Projects → ahus1 → keycloak-dropwizard-integration

ahus1 / keycloak-dropwizard-integration

Licence: Apache-2.0 license
This project shows how JBoss Keycloak and Dropwizard can be used together.

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language
FreeMarker
481 projects
shell
77523 projects
HTML
75241 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to keycloak-dropwizard-integration

dropwizard-mongo
A Dropwizard bundle for MongoDB
Stars: ✭ 20 (-59.18%)
Mutual labels:  dropwizard, dropwizard-bundle
dropwizard-crypto
A Crytpographic Bundle for Dropwizard
Stars: ✭ 14 (-71.43%)
Mutual labels:  dropwizard, dropwizard-bundle
keycloak-mail-whitelisting
Keycloak extension to whitelist email adresses domain when users register
Stars: ✭ 36 (-26.53%)
Mutual labels:  keycloak
oidckube
Wrapper for minikube that provisions and integrates it with Keycloak
Stars: ✭ 40 (-18.37%)
Mutual labels:  keycloak
vagrant-codes-in-practice
Vagrant code files similar to the real bare metal environments
Stars: ✭ 22 (-55.1%)
Mutual labels:  keycloak
Keycloak.Net
C# client for Keycloak 6.x
Stars: ✭ 100 (+104.08%)
Mutual labels:  keycloak
spring-boot-web-application-sample
Real World Spring Boot Web Application Example with tons of ready to use features
Stars: ✭ 143 (+191.84%)
Mutual labels:  keycloak
gocloaksession
Maintains an active keycloak session using gocloak
Stars: ✭ 15 (-69.39%)
Mutual labels:  keycloak
oso-backend
Heart of the oso project.
Stars: ✭ 12 (-75.51%)
Mutual labels:  keycloak
Supertokens Core
Open source alternative to Auth0 / Firebase Auth / AWS Cognito
Stars: ✭ 2,907 (+5832.65%)
Mutual labels:  keycloak
keycloak-springsecurity5-sample
Spring Security 5 OAuth2 Client/OIDC integration with Keycloak sample
Stars: ✭ 55 (+12.24%)
Mutual labels:  keycloak
Keycloak
Open Source Identity and Access Management For Modern Applications and Services
Stars: ✭ 10,826 (+21993.88%)
Mutual labels:  keycloak
keycloak-sso
custom account management template, keycloak authentication and authorization
Stars: ✭ 41 (-16.33%)
Mutual labels:  keycloak
scim-for-keycloak
a third party module that extends keycloak by SCIM functionality
Stars: ✭ 127 (+159.18%)
Mutual labels:  keycloak
keycloak-mysql-user-federation
Keycloak user federation extension to connect to a MySQL database containing users
Stars: ✭ 17 (-65.31%)
Mutual labels:  keycloak
keycloak-phone-provider
A Keycloak provider which phone and SMS
Stars: ✭ 83 (+69.39%)
Mutual labels:  keycloak
ProxyInjector
A Kubernetes controller to inject an authentication proxy container to relevant pods - [✩Star] if you're using it!
Stars: ✭ 77 (+57.14%)
Mutual labels:  keycloak
springboot-keycloak-mongodb-testcontainers
Goals: 1) Create a Spring Boot application that manages books; 2) Use Keycloak as authentication and authorization server; 3) Test using Testcontainers; 4) Explore the utilities and annotations that Spring Boot provides when testing applications.
Stars: ✭ 18 (-63.27%)
Mutual labels:  keycloak
spring-boot-keycloak-angular
Securing a Angular frontend and a Spring Boot backend with Keycloak and Spring Security
Stars: ✭ 40 (-18.37%)
Mutual labels:  keycloak
dropwizard-elasticsearch
A set of classes for using Elasticsearch in a Dropwizard service.
Stars: ✭ 61 (+24.49%)
Mutual labels:  dropwizard

Integration of Keycloak and Dropwizard

About

Summary

This project shows how JBoss Keycloak and Dropwizard can be used together.

To read this tutorial fully rendered, please visit: https://ahus1.github.io/keycloak-dropwizard-integration/tutorial.html.

JBoss Keycloak provides a standalone OAuth 2.0 and Open ID Connect server. It handles user credentials for your application, so you can focus on business requirements.

Dropwizard is a Java framework for developing ops-friendly, high-performance, RESTful web services.

TL;DR: The module keycloak-dropwizard-jaxrs-example shows how to use Dropwizard’s @Auth annotation with Keycloak using a full OAuth flow. If you have i.e. a JavaScript-Client and want to send only JWT Tokens, go directly to keycloak-dropwizard-bearermodule

At the time I write this there is no open source integration of the two, so I set up this project. See https://github.com/ahus1/keycloak-dropwizard-integration for the latest version.

How to use

The module keycloak-dropwizard-jaxrs is a ready-to-use Dropwizard module. The releases are available from Maven central.

The releases depend on a version of Dropwizard and Keycloak that was current at release time. To use a more recent release, please add them as an explicit dependency to your project, as this project will not release new versions on every minor or patch release of its dependencies.

Maven Central Build Status

  • Version 0.7.x is tested with Keycloak 1.9.x and Dropwizard 0.9.x

  • Version 0.8.x is tested with Keycloak 2.x.x and Dropwizard 0.9.x

  • Version 0.9.x is tested with Keycloak 2.x.x/3.x.x and Dropwizard 1.0.x

  • Version 1.0.x is tested with Keycloak 3.x.x and Dropwizard 1.1.x/1.2.x/1.3.x

  • Version 1.1.x/1.2.x is tested with Keycloak 4.x-18.x and Dropwizard 1.3.x/2.0.x/2.1.x

Warning

Starting with Dropwizard 2.0 and the included version of Jersey, a login performed during a POST for a form will not recover the contents of the POST. This is wired into Keycloak’s JettyAdapterSessionStore (that restores the content type and the parameters to the request), but Jersey’s InboundMessageContext that wants to read the information the request’s header and the body. See the shouldLoginFromPost() test case for an example.

pom.xml
<dependencies>
  <dependency>
    <groupId>de.ahus1.keycloak.dropwizard</groupId>
    <artifactId>keycloak-dropwizard</artifactId>
    <version>x.x.x</version>
  </dependency>
</dependencies>

The most recent development version (based on the master branch on GitHub) is available from the Sonatype OSS Snapshot Repository. To use it, include the following repository in your pom.xml.

pom.xml
<repositories>
    <repository>
        <id>snapshots-repo</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        <releases><enabled>false</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
    </repository>
</repositories>

Prerequisites

These examples need a local JBoss Keycloak instance with Realm test and user demo with password demo.

Please download the Keycloak distribution matching your keycloak-dropwizard-integration version from http://keycloak.org and extract it to a subfolder keycloak-server of this directory. Then call keycloak-server.bat to import an already configured realm. Using this startup file the configuration will be reset every time you start Keycloak.

Parts

This example will guide you through setting up JBoss Keycloak in several configurations:

For completeness and as a very simple getting started a standard Servlet configuration is also included (without and with Keycloak):

License

Copyright 2015-2021 Alexander Schwartz and the individual contributors.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the 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].