package Net::OAuth2::AuthorizationServer;

=head1 NAME

Net::OAuth2::AuthorizationServer - Easier implementation of an OAuth2
Authorization Server

=for html
<a href=''><img src='' alt='Build Status' /></a>
<a href=''><img src='' alt='Coverage Status' /></a>

=head1 VERSION



    my $Server = Net::OAuth2::AuthorizationServer->new;

    my $Grant  = $Server->$grant_type(


This module is the gateway to the various OAuth2 grant flows, as documented
at L<>. Each module implements a specific
grant flow and is designed to "just work" with minimal detail and effort.

Please see L<Net::OAuth2::AuthorizationServer::Manual> for more information
on how to use this module and the various grant types. You should use the manual
in conjunction with the grant type module you are using to understand how to
override the defaults if the "just work" mode isn't good enough for you.


use strict;
use warnings;

use Moo;
use Types::Standard qw/ :all /;

use Net::OAuth2::AuthorizationServer::AuthorizationCodeGrant;
use Net::OAuth2::AuthorizationServer::ImplicitGrant;
use Net::OAuth2::AuthorizationServer::PasswordGrant;
use Net::OAuth2::AuthorizationServer::ClientCredentialsGrant;

our $VERSION = '0.23';


=head2 auth_code_grant

OAuth Authorisation Code Grant as document at L<>.

See L<Net::OAuth2::AuthorizationServer::AuthorizationCodeGrant>.


sub auth_code_grant {
    my ( $self, @args ) = @_;
    return Net::OAuth2::AuthorizationServer::AuthorizationCodeGrant->new( @args );

=head2 implicit_grant

OAuth Implicit Grant as document at L<>.

See L<Net::OAuth2::AuthorizationServer::ImplicitGrant>.


sub implicit_grant {
    my ( $self, @args ) = @_;
    return Net::OAuth2::AuthorizationServer::ImplicitGrant->new( @args );

=head2 password_grant

OAuth Resource Owner Password Grant as document at L<>.

See L<Net::OAuth2::AuthorizationServer::PasswordGrant>.


sub password_grant {
    my ( $self, @args ) = @_;
    return Net::OAuth2::AuthorizationServer::PasswordGrant->new( @args );

=head2 client_credentials_grant

OAuth Client Credentials Grant as document at L<>.

See L<Net::OAuth2::AuthorizationServer::ClientCredentialsGrant>.


sub client_credentials_grant {
    my ( $self, @args ) = @_;
    return Net::OAuth2::AuthorizationServer::ClientCredentialsGrant->new( @args );

=head1 SEE ALSO

L<Mojolicious::Plugin::OAuth2::Server> - A Mojolicious plugin using this module

L<Crypt::JWT> - encode/decode JWTs


Lee Johnson - C<>

With contributions from:

Martin Renvoize - C<>

Pierre VIGIER - C<>

Ian Sillitoe - L<>

Mirko Tietgen - L<>

Dylan William Hardison - L<>

=head1 LICENSE

This library is free software; you can redistribute it and/or modify it under
the same terms as Perl itself. If you would like to contribute documentation
or file a bug report then please raise an issue / pull request: