<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cirrusidentity / simplesamlphp-module-authoauth2 example snippets
'oauth2' => array(
'authoauth2:OAuth2',
// *** Required for all integrations ***
'urlAuthorize' => 'https://www.example.com/oauth2/authorize',
'urlAccessToken' => 'https://www.example.com/oauth2/token',
'urlResourceOwnerDetails' => 'https://api.example.com/userinfo',
// You can add query params directly to urlResourceOwnerDetails or use urlResourceOwnerOptions.
'urlResourceOwnerOptions' => [
'fields' => 'id,name,first_name,last_name,email'
],
// allow fields from token response to be query params on resource owner details request
'tokenFieldsToUserDetailsUrl' => [
'fieldName' => 'queryParamName',
'access_token' => 'access_token',
'user_id' > 'user_id',
],
// *** Required for most integrations ***
// Test App.
'clientId' => '133972730583345',
'clientSecret' => '36aefb235314bad5df075363b79cbbcd',
// *** Optional ***
// Custom query parameters to add to authorize request
'urlAuthorizeOptions' => [
'prompt' => 'always',
// The underlying OAuth2 library also supports overriding requested scopes
//'scope' => ['other']
],
'useConsentErrorPage' => false|true,
// If set to true then /linkback.php, /logout.php, /loggedout.php, /consent/error.php legacy route is enabled
// if set to false or omitted the /linkback, /logout, /loggedout, /consent/error route is enable
'useLegacyRoutes' => false|true,
// Default scopes to request
'scopes' => ['email', 'profile'],
'scopeSeparator' => ' ',
// Customize redirect, if you don't want to use the standard /module.php/authoauth2/linkback.php
'redirectUri' => 'https://myapp.example.com/callback',
// See League\OAuth2\Client\Provider\GenericProvider for more options
// Guzzle HTTP config
// Wait up to 3.4 seconds for Oauth2 servers to respond
//http://docs.guzzlephp.org/en/stable/request-options.html#timeout
'timeout' => 3.4,
// http://docs.guzzlephp.org/en/stable/request-options.html#proxy
'proxy' => [
],
// All attribute keys will have this prefix
'attributePrefix' => 'someprefix.',
// Enable logging of request/response. This *will* leak you client secret and tokens into the logs
'logHttpTraffic' => true, //default is false
'logMessageFormat' => 'A Guzzle MessageFormatter format string', // default setting is sufficient for most debugging
'logIdTokenJson' => true, //default false. Log the json in the ID token.
),
'openidconnect' => array(
'authoauth2:OpenIDConnect',
// *** Required for all integrations ***
'issuer' => 'https://www.example.com', # e.g https://accounts.google.com
'clientId' => '133972730583345',
'clientSecret' => '36aefb235314bad5df075363b79cbbcd',
// Most Optional settings for OAuth2 above can be used
// *** Optional ***
// Customize post logout redirect, if you don't want to use the standard /module.php/authoauth2/loggedout.php
'postLogoutRedirectUri' => 'https://myapp.example.com/loggedout'
// Set a specific discovery url. Default is $issuer/.well-known/openid-configuration
'discoveryUrl' => 'https://login.microsoftonline.com/common/.well-known/openid-configuration',
// Check if the issuer in the ID token matches the one from discovery. Default true. For some multi-tenant
// applications (for example cross tenant Azure logins) the token issuer varies with tenant
'validateIssuer' => false,
// Earlier version OpenIDConnect authsource doesn't support using `scopes` for overriding scope
//'urlAuthorizeOptions' => [
// 'scope' => 'openid'
//]
),