NAME
Punk::OAuth2 - OAuth2 and OpenID Connect for Punk applications
VERSION
Version 0.09
SYNOPSIS
package MyApp;
use Punk;
use Punk::Plugin::OAuth2;
plugin 'OAuth2';
session secret => secret('session_key'), expires => '7d';
oauth2 google => {
preset => 'google',
client_id => secret('oauth.google_id'),
client_secret => secret('oauth.google_secret'),
scope => 'openid email profile',
};
oauth2_login '/auth' => {
on_login => 'Auth#on_login',
base_url => 'https://app.example.com',
};
1;
DESCRIPTION
Punk::OAuth2 gives a Punk application both sides of OAuth2 and OpenID Connect:
the client: "Log in with ..." against Google, GitHub, or any OIDC provider, using the authorization code flow with PKCE, signed state, and id_token verification through Crypt::JWS;
an authorization server and OpenID Provider (Punk::OAuth2::Server): authorization code with PKCE, refresh, client credentials and device authorization grants; id_tokens, UserInfo, RP-initiated logout,
prompt/max_age/acr, pairwise subjects and dynamic registration;the resource server side (Punk::OAuth2::Checker): validating the Bearer tokens either issues.
The behaviour lives in Punk::Plugin::OAuth2 and the modules above; this module is the distribution's version anchor and documentation front door.
SEE ALSO
Punk::Plugin::OAuth2 - the plugin, keywords, and flow reference
Punk::OAuth2::Server - the authorization server
Punk::OAuth2::Checker - resource-server token checkers
Crypt::JWS - the signature engine
Punk - the web framework
AUTHOR
LNATION, <email at lnation.org>
LICENSE AND COPYRIGHT
This software is Copyright (c) 2026 by LNATION <email@lnation.org>.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)