NAME

Net::Async::Keycloak - Async Perl client for Keycloak identity management (IO::Async + Future)

VERSION

version 0.001

SYNOPSIS

use IO::Async::Loop;
use Future::AsyncAwait;
use Net::Async::Keycloak;

my $loop = IO::Async::Loop->new;
my $kc   = Net::Async::Keycloak->new(
  base_url => 'https://id.example.org',
  realm    => 'main',
  username => 'admin',
  password => $ENV{KEYCLOAK_ADMIN_PASSWORD},
);
$loop->add($kc);

my $claims = await $kc->oidc->verify_token_f( $jwt, audience => 'my-api', type => 'Bearer' );
my $r      = await $kc->admin->ensure_client_f( clientId => 'my-cli', publicClient => \1 );

DESCRIPTION

The asynchronous twin of WWW::Keycloak, on IO::Async and Future: the same facade, the same parts, every method with _f returning a future. Requests are built and responses read by the same code as in the sync client, and the ensure_*_f methods compare with the same WWW::Keycloak::Diff, so both clients do the same thing to a realm.

Add the object to a loop before the first request: the Net::Async::HTTP it sends through is its child notifier.

base_url

realm

Required, as in WWW::Keycloak. A trailing slash on base_url is removed.

username

password

client_id

client_secret

token

The admin login, as in WWW::Keycloak.

auth_realm

As in WWW::Keycloak.

http

The Net::Async::HTTP every part shares, built as a child of this notifier. Pass one in to share it; it is then not added as a child.

auth

The Net::Async::Keycloak::Auth, or undef without admin login.

oidc

The Net::Async::Keycloak::OIDC of this realm.

admin

The Net::Async::Keycloak::Admin of this realm.

issuer

for_realm

my $dev = $kc->for_realm('dev');

The same client for another realm, sharing the Net::Async::HTTP and the admin login. The new object is not a notifier of its own in any loop; it sends through the shared http.

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-net-async-keycloak/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.