OpenRung
A free, privacy-first relay network that helps you reach the open internet. Open source and nonprofit-run.
翻訳待ち
Secure Java applications with pac4j: authentication and authorization with OpenID Connect, SAML, CAS, OAuth and JWT across Spring Boot and other frameworks.
翻訳待ち
セキュリティJava · ShellGitHub @pac4j接続状況の再確認が必要です所有者未確認
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Security engine for Java (authentication, authorization, multi frameworks): OpenID Connect, SAML2, CAS, OAuth, LDAP, JWT...
翻訳待ち
Loading the full README.
Read the full README ↗Add the Spring MVC integration and the OpenID Connect module:
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>spring-webmvc-pac4j</artifactId>
<version>8.0.4</version>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-oidc</artifactId>
<version>6.6.1</version>
</dependency>
Then define your identity provider and the URLs to protect:
@Configuration
public class SecurityConfig extends Pac4jSecurityConfig {
@Bean
public Config config() {
final var oidc = new OidcConfiguration()
.setDiscoveryURI("https://www.casserverpac4j.dev/oidc/.well-known/openid-configuration")
.setClientId("myclient")
.setSecret("mysecret")
.setAllowUnsignedIdTokens(true); // only for this demo server
return new Config("http://localhost:8080/callback", new OidcClient(oidc));
}
@Override
public void addInterceptors(final InterceptorRegistry registry) {
addSecurity(registry, "OidcClient").addPathPatterns("/protected/**");
}
}
That's it: /protected/** now requires an OpenID Connect login, and the user profile is available through the ProfileManager.
Switching to Keycloak, Google or Microsoft Entra ID is a matter of changing the client:
read the full guide or run the demo.
| Framework | Get started |
|---|---|
| Spring Web MVC / Spring Boot | OpenID Connect guide |
| Spring Security / Spring Boot | OpenID Connect guide |
| Spring WebFlux / Spring Boot | OpenID Connect guide |
| Jakarta EE | OpenID Connect guide |
| Play 2.x / 3.x | SAML guide |
| Vert.x | CAS guide |
| Javalin | SAML guide |
| JAX-RS | OpenID Connect guide |
| Dropwizard | OpenID Connect guide |
| Spark Java | OpenID Connect guide |
| Undertow | OpenID Connect guide |
| Apache Shiro | CAS guide |
| Jooby • http4s • Ratpack • (archived) • (archived) |
pac4j also powers the authentication delegation of Apereo CAS, Apache Syncope and Apache Knox.
| Login protocols | Credentials validation |
|---|---|
| OpenID Connect • SAML • CAS • OAuth • HTTP • Kerberos • OpenID4VP (EUDI wallet, eIDAS 2.0) | LDAP • SQL • JWT • MongoDB • IP address • REST API |
This is the beginning of the README. Read the rest at the original. Read the full README ↗
| Jooby • http4s • Ratpack • Lagom • Akka HTTP |