NAME

Net::Async::Authentik::OIDC - OpenID Connect against one authentik application, asynchronously

VERSION

version 0.001

SYNOPSIS

my $oidc   = $ak->oidc;
my $claims = await $oidc->verify_token_f( $jwt, type => 'access' );
my $tokens = await $oidc->client_credentials_token_f( client_id => $id, client_secret => $secret );

DESCRIPTION

The asynchronous WWW::Authentik::OIDC: the same methods with _f and futures, the same rules, including when the keys are fetched again and what type can and cannot tell.

Two things are its own. Callers asking for the discovery document or the signing keys while a fetch is under way share that one fetch instead of starting their own, and each gets a view that can be cancelled without taking the fetch down with it. And nothing throws: every method returns a future, and a wrong argument fails it.

application_url

<base_url>/application/o/<slug>, without a trailing slash. Undef when the facade was built without an application; every method then fails with a validation error.

http

Required. The Net::Async::HTTP to send through.

client_id

The client id of this application's provider. When it is set, "verify_token_f" checks it as the audience unless the caller names another one.

algorithms

jwks_min_age

now

As in WWW::Authentik::OIDC.

discovery_f

my $document = await $oidc->discovery_f;

The discovery document, fetched once and kept. Callers asking while the fetch is under way share it.

endpoint_f

my $url = await $oidc->endpoint_f('device_authorization_endpoint');

A URL from the discovery document. Fails when it is missing.

issuer_f

What authentik puts into iss and what "verify_token_f" checks against.

authorization_endpoint_f

token_endpoint_f

userinfo_endpoint_f

introspection_endpoint_f

revocation_endpoint_f

end_session_endpoint_f

device_endpoint_f

jwks_uri_f

The endpoints out of the discovery document.

jwks_f

my $keys = await $oidc->jwks_f;
my $keys = await $oidc->jwks_f( force_refresh => 1 );

The application's public signing keys, kept after the first fetch. Callers asking while a fetch is under way share it.

issuer_names_the_application_f

True when the issuer out of the discovery document is this application's own address, which is what issuer_mode: per_provider gives. False under issuer_mode: global, where every provider of the instance issues tokens under the bare instance URL.

verify_token_f

my $claims = await $oidc->verify_token_f( $jwt );
my $claims = await $oidc->verify_token_f( $jwt, audience => $client_id, type => 'access' );

As "verify_token" in WWW::Authentik::OIDC, returning a future. Checks signature, issuer, expiry and audience.

The audience is what separates two applications of one authentik. Every provider of an instance signs with the same key, so the issuer is the only other thing that could tell them apart — and with issuer_mode: global the issuer is the bare instance URL, the same for all of them. Verifying without an audience on such an instance would accept any token it ever issued, so this method refuses to: give audience, set "client_id" on the client, or pass any_audience => 1.

type is a heuristic. authentik signs ID tokens and access tokens the same way and puts no typ into the JOSE header; the only reliable difference is that an access token carries a scope claim. Without type the kind of token is not checked.

userinfo_f

introspect_f

revoke_f

client_credentials_token_f

refresh_token_f

exchange_authorization_code_f

device_authorization_f

device_token_f

As the methods without _f in WWW::Authentik::OIDC, returning futures. A device-flow poll before anyone has approved fails with an API error whose oauth_error is authorization_pending.

authorization_url_f

my $url = await $oidc->authorization_url_f( client_id => $id, redirect_uri => $uri, scope => 'openid' );

The address a browser is sent to. A future, because the endpoint comes out of the discovery document.

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-net-async-authentik/issues.

IRC

Join #kubernetes on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.