2017 © Pedro Peláez
 

library socialite-openshift

OpenShift OAuth2 Provider for Laravel Socialite

image

andrewklau/socialite-openshift

OpenShift OAuth2 Provider for Laravel Socialite

  • Thursday, April 6, 2017
  • by andrewklau
  • Repository
  • 0 Watchers
  • 0 Stars
  • 329 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

OpenShift OAuth2 Provider for Laravel Socialite

Documentation

This package makes use of the SocialiteProviders package located here., (*1)

Install the package

composer require andrewklau/socialite-openshift

Install the Service Provider

  • Remove Laravel\Socialite\SocialiteServiceProvider from your providers[] array in config\app.php if you have added it already., (*2)

  • Add \SocialiteProviders\Manager\ServiceProvider::class to your providers[] array in config\app.php., (*3)

Install the event listener

  • Add SocialiteProviders\Manager\SocialiteWasCalled event to your listen[] array in <app_name>/Providers/EventServiceProvider., (*4)

  • The listener that you add for this provider is 'Andrewklau\Socialite\OpenShift\OpenShiftkExtendSocialite@handle',., (*5)

For example:, (*6)

/**
 * The event handler mappings for the application.
 *
 * @var array
 */
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // add your listeners (aka providers) here
        'Andrewklau\Socialite\OpenShift\OpenShiftExtendSocialite@handle',
    ],
];

Environment variables

If you add environment values to your .env as exactly shown below, you do not need to add an entry to the services array., (*7)

Append to .env

// other values above
OPENSHIFT_URL=https://api.xyz.com
OPENSHIFT_CA=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
OPENSHIFT_OAUTH_CLIENT_ID=yourkeyfortheservice
OPENSHIFT_OAUTH_CLIENT_SECRET=yoursecretfortheservice

Append to config/services.php

You do not need to add this if you add the values to the .env exactly as shown above. The values below are provided as a convenience in the case that a developer is not able to use the .env method, (*8)

'openshift' => [
    'client_id'     => env('OPENSHIFT_OAUTH_CLIENT_ID'),
    'client_secret' => env('OPENSHIFT_OAUTH_CLIENT_SECRET'),
    'url'           => env('OPENSHIFT_URL'),
    'ca'            => env('OPENSHIFT_CA'),
    'redirect'      => env('APP_URL').'/login/callback',
],

Create OpenShift oAuth Client

oc create -f <(echo '
kind: OAuthClient
apiVersion: v1
metadata:
 name: laravel
secret: "..."
redirectURIs:
 - "https://localhost/login/callback"
grantMethod: prompt
')

Usage

Redirect to OpenShift with the scopes you want to access:, (*9)

return Socialite::with('OpenShift')->scopes()->redirect();

License

MIT, (*10)

The Versions

06/04 2017

dev-master

9999999-dev

OpenShift OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires

 

by Andrew Lau

06/04 2017

v2.0.2

2.0.2.0

OpenShift OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires

 

by Andrew Lau

31/03 2017

2.0.1

2.0.1.0

OpenShift OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires

 

by Andrew Lau

08/03 2017

v2.0.0

2.0.0.0

OpenShift OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires

 

by Andrew Lau

13/11 2016

v1.0.0

1.0.0.0

OpenShift OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires

 

by Andrew Lau