NAME

Dancer2::Plugin::Auth::SAFE - Thomson Reuters SAFE SSO authentication plugin for Dancer2

VERSION

version 0.002

DESCRIPTION

With this plugin you can easily integrate Thomson Reuters SAFE SSO authentication into your application.

SYNOPSIS

Add plugin configuration into your config.yml

plugins:
    Auth::SAFE:
        safe_url: "https://safe-test.thomson.com/login/sso/SSOService?app=app"
        shared_secret: "fklsjf5GlkKJ!gs/skf"

Define that a user must be logged in to access a route - and find out who is logged in with the logged_in_user keyword:

use Dancer2::Plugin::Auth::SAFE;

get '/users' => require_login sub {
    my $user = logged_in_user;
    return "Hi there, $user->{firstname}";
};

ATTRIBUTES

safe_url

shared_secret

SUBROUTINES/METHODS

require_login

Used to wrap a route which requires a user to be logged in order to access it.

get '/profile' => require_login sub { .... };

logged_in_user

Returns a hashref of details of the currently logged-in user, if there is one.

AUTHOR

Konstantin Matyukhin <kmatyukhin@gmail.com>

LICENSE AND COPYRIGHT

Copyright (c) 2016 by Konstantin Matyukhin

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