LaravelPackages.net
Acme Inc.
Toggle sidebar
scoutingrudyardkipling/solopenidclient

Lightweight PHP5+ library for easy SOL OpenID authentication.

609
1
1.0.3
About scoutingrudyardkipling/solopenidclient

scoutingrudyardkipling/solopenidclient is a Laravel package for lightweight php5+ library for easy sol openid authentication.. It currently has 1 GitHub stars and 609 downloads on Packagist (latest version 1.0.3). Install it with composer require scoutingrudyardkipling/solopenidclient. Discover more Laravel packages by scoutingrudyardkipling or browse all Laravel packages to compare alternatives.

Last updated

Scouting Nederland OpenId Client

Installatie

Deze package is met composer toe te voegen middels het volgende commando:

composer require scoutingrudyardkipling/solopenidclient

Voorbeeld (Laravel 5.x)

public function login(Illuminate\Http\Request $request)
{
    $openid = new \ScoutingRudyardKipling\SOLOpenIdClient('http://your-return-url.nl');

    if (!$openid->mode && $request->has('username')) {
        $username = $request->input('username');

        return \Redirect::to($openid->setUserIdentity($username)->authUrl());
    } elseif (!!$openid->mode) {
        if ($openid->mode == 'cancel') {
            // user cancelled logging in
        } elseif ($openid->validate()) {
            // user login confirmed by Scouting Nederland, let's proceed!

            $user = $openid->getValidatedUser();

            // Either create a new user or link the returned SNL-user to one of your registered users.
            // Notice that SNL only confirmed that the user is who it claims to be and that he/she is an active
            // member of Scouting Nederland. You have to deal with authorisation yourself for instance to make sure
            // the authenticated user is a member of your scouting club.

        } else {
            // login failed
        }
    } else {
        // show a form where the user can provide his/her SNL username
    }
}
Comments