X-Git-Url: https://git-public.kairo.at/?p=authserver.git;a=blobdiff_plain;f=app%2Fserver.inc.php;fp=app%2Fserver.inc.php;h=87b6535d4132b694d008bf3076caf794d8596963;hp=0000000000000000000000000000000000000000;hb=04116cc5dabb951023fb511fda0dc36956d6a84a;hpb=c4e0aceb5d9e9076effd75de03f4588b65329740 diff --git a/app/server.inc.php b/app/server.inc.php new file mode 100644 index 0000000..87b6535 --- /dev/null +++ b/app/server.inc.php @@ -0,0 +1,36 @@ + false, + 'always_issue_new_refresh_token' => true, // Needs to be handed below as well as there it's not constructed from within the server object. + 'refresh_token_lifetime' => 90*24*3600, +); + +// Pass a storage object or array of storage objects to the OAuth2 server class +$server = new OAuth2\Server($oauth2_storage, $oauth2_config); + +// Add the "Client Credentials" grant type (it is the simplest of the grant types) +//$server->addGrantType(new OAuth2\GrantType\ClientCredentials($storage)); + +// Add the "Authorization Code" grant type (this is where the oauth magic happens) +$server->addGrantType(new OAuth2\GrantType\AuthorizationCode($oauth2_storage)); + +// Add the "Refresh Token" grant type (required to get longer-living resource access by generating new access tokens) +$server->addGrantType(new OAuth2\GrantType\RefreshToken($oauth2_storage, array('always_issue_new_refresh_token' => true))); + +?>