<<

NAME

Koha::Auth::Identity::Provider - Koha Auth Provider Object class

API

Class methods

domains

    my $domains = $provider->domains;

Returns the related Koha::Auth::Identity::Provider::Domains iterator.

get_config

    my $config = $provider->get_config;

Returns a hashref containing the configuration parameters for the provider.

set_config

    # OAuth
    $provider->set_config(
        {
            key           => 'APP_ID',
            secret        => 'SECRET_KEY',
            authorize_url => 'https://provider.example.com/auth',
            token_url     => 'https://provider.example.com/token',
        }
    );

    # OIDC
    $provider->set_config(
        {
            key           => 'APP_ID',
            secret        => 'SECRET_KEY',
            well_known_url => 'https://login.microsoftonline.com/tenant-id/v2.0/.well-known/openid-configuration',
        }
    );

This method stores the passed config in JSON format.

get_mapping

    my $mapping = $provider->get_mapping;

Returns a hashref containing the attribute mapping for the provider.

set_mapping

    $provider->mapping( $mapping );

This method stores the passed mappings in JSON format.

upgrade_class

    my $upgraded_object = $provider->upgrade_class

Returns a new instance of the object, with the right class.

Internal methods

to_api

    my $json = $provider->to_api;

Overloaded method that returns a JSON representation of the Koha::Auth::Identity::Provider object, suitable for API output.

_type

protocol_to_class_mapping

    my $mapping = Koha::Auth::Identity::Provider::protocol_to_class_mapping

Internal method that returns a mapping between protocol codes and implementing classes. To be used by upgrade_class.

mandatory_config_attributes

Stub method for raising exceptions on invalid protocols.

<<