Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 207 | All time: 8,406 This week: 524 |
Version | License | PHP version | Categories | |||
client-oauth2 1.0.0 | MIT/X Consortium ... | 5 | PHP 5, User Management, Web services |
Description | Author | |
This package can authorize and access servers using OAuth2. |
Provides a simple and clean Abstraction for Integration with OAuth 2.0 Server Providers.
$auth = new \Poirot\OAuth2Client\Client(
'http://172.17.0.1:8000/'
, 'test@default.axGEceVCtGqZAdW3rc34sqbvTASSTZxD'
, 'xPWIpmzBK38MmDRd'
);
$url = $auth->attainAuthorizationUrl( $auth->withGrant('implicit') );
Retrieve Redirection To Authorize Url:
$url = $auth->attainAuthorizationUrl( $auth->withGrant(GrantPlugins::AUTHORIZATION_CODE) );
When User redirect back include Auth Code:
/ @var iAccessTokenObject $token */
$token = $auth->attainAccessToken(
$auth->withGrant(GrantPlugins::AUTHORIZATION_CODE, ['code' => 'your_auth_code'])
);
$token->getAccessToken();
$token->getScopes();
$token->getDateTimeExpiration();
// ...
override default scopes request
$token = $auth->attainAccessToken(
$auth->withGrant(GrantPlugins::CLIENT_CREDENTIALS, [ 'scopes' => ['override' ,'scopes'] ])
);
Specific Params Passed As Argument To Grant Factory
try {
$auth->attainAccessToken(
$auth->withGrant('password')
);
} catch (\Poirot\OAuth2Client\Exception\exMissingGrantRequestParams $e) {
// Request Param "username" & "password" must Set.
echo $e->getMessage();
$token = $token = $auth->attainAccessToken(
$auth->withGrant('password', ['username' => 'payam', 'password' => '123456'])
);
$refreshTokenStr = $token->getRefreshToken();
}
Specific Poirot Server Federation Commands To Deal 3rd party application with Server.
! For Federation Calls we need valid token: this token can strictly defined to client or retrieve from server.
example below show token asserted from oauth server when required!
// Setup OAuth2 Client
$client = new \Poirot\OAuth2Client\Client(
'http://172.17.0.1:8000/'
, 'test@default.axGEceVCtGqZAdW3rc34sqbvTASSTZxD'
, 'xPWIpmzBK38MmDRd'
);
// Token Provider for Federation Calls
// Use Credential Grant as Grant Type for Tokens
$tokenProvider = new TokenFromOAuthClient(
$client
, $client->withGrant('client_credentials')
);
// Note:
// Make Calls and Don`t Worry About Token Renewal And Expired Tokens.
// Platfrom Will Handle It.
$federation = new \Poirot\OAuth2Client\Federation(
'http://172.17.0.1:8000/'
, $tokenProvider
);
// Check wheather this identifier(s) is given by any user?
$checkExists = $federation->checkIdentifierGivenToAnyUser([
'email' => 'naderi.payam@gmail.com',
'mobile' => [
'number' => '9355497674',
'country' => '+98',
],
]);
Files (75) |
File | Role | Description | ||
---|---|---|---|---|
mod (2 files, 5 directories) | ||||
src (3 files, 7 directories) | ||||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Files (75) | / | mod |
File | Role | Description | ||
---|---|---|---|---|
Actions (3 files) | ||||
Authenticate (3 files) | ||||
Authenticator (1 file) | ||||
config (3 files, 1 directory) | ||||
Services (1 file, 2 directories) | ||||
Module.php | Class | Class source | ||
_functions.php | Example | Example script |
Files (75) | / | mod | / | Actions |
File | Role | Description |
---|---|---|
AssertDebugTokenAction.php | Class | Class source |
AssertTokenAction.php | Class | Class source |
ServiceAssertTokenAction.php | Class | Class source |
Files (75) | / | mod | / | Authenticate |
File | Role | Description |
---|---|---|
IdentifierHttpToken.php | Class | Class source |
IdentifierTokenAssertion.php | Class | Class source |
IdentityOAuthToken.php | Class | Class source |
Files (75) | / | mod | / | Authenticator |
File | Role | Description |
---|---|---|
OAuthTokenAuthenticatorPlugin.php | Class | Class source |
Files (75) | / | mod | / | config |
File | Role | Description | ||
---|---|---|---|---|
oauth2client (3 files) | ||||
mod-oauth2client.actions.conf.php | Class | Class source | ||
mod-oauth2client.conf.php | Class | Class source | ||
mod-oauth2client.services.conf.php | Class | Class source |
Files (75) | / | mod | / | config | / | oauth2client |
File | Role | Description |
---|---|---|
client_credential.conf.php | Aux. | Auxiliary script |
federation.conf.php | Example | Example script |
token_assertion.conf.php | Class | Class source |
Files (75) | / | mod | / | Services |
File | Role | Description | ||
---|---|---|---|---|
Authenticate (2 files) | ||||
Authenticators (1 file) | ||||
ServiceOAuthClient.php | Class | Class source |
Files (75) | / | mod | / | Services | / | Authenticate |
File | Role | Description |
---|---|---|
IdentityProviderFederation.php | Class | Class source |
ServiceIdentityProviderFederation.php | Class | Class source |
Files (75) | / | mod | / | Services | / | Authenticators |
File | Role | Description |
---|---|---|
ServiceAuthenticatorToken.php | Class | Class source |
Files (75) | / | src |
File | Role | Description | ||
---|---|---|---|---|
Assertion (3 files, 1 directory) | ||||
Client (3 files, 2 directories) | ||||
Exception (11 files) | ||||
Federation (1 file, 2 directories) | ||||
Grant (6 files, 2 directories) | ||||
Interfaces (5 files) | ||||
Model (1 directory) | ||||
Client.php | Class | Class source | ||
Federation.php | Class | Class source | ||
_functions.php | Example | Example script |
Files (75) | / | src | / | Assertion |
File | Role | Description | ||
---|---|---|---|---|
RemoteServer (1 file) | ||||
aAssertToken.php | Class | Class source | ||
AssertByInternalServer.php | Class | Class source | ||
AssertByRemoteServer.php | Class | Class source |
Files (75) | / | src | / | Assertion | / | RemoteServer |
File | Role | Description |
---|---|---|
GrantExtension.php | Class | Class source |
Files (75) | / | src | / | Client |
File | Role | Description | ||
---|---|---|---|---|
Command (2 files) | ||||
PlatformRest (1 file) | ||||
aOAuthPlatform.php | Class | Class source | ||
PlatformRest.php | Class | Class source | ||
Response.php | Class | Class source |
Files (75) | / | src | / | Client | / | Command |
File | Role | Description |
---|---|---|
GetAuthorizeUrl.php | Class | Class source |
Token.php | Class | Class source |
Files (75) | / | src | / | Client | / | PlatformRest |
File | Role | Description |
---|---|---|
ServerUrlEndpoints.php | Class | Class source |
Files (75) | / | src | / | Exception |
File | Role | Description |
---|---|---|
exIdentifierExists.php | Class | Class source |
exInvalidRequest.php | Class | Class source |
exMissingGrantRequestParams.php | Class | Class source |
exOAuthAccessDenied.php | Class | Class source |
exOAuthScopeRequired.php | Class | Class source |
exPasswordNotMatch.php | Class | Class source |
exResponseError.php | Class | Class source |
exServerError.php | Class | Class source |
exTokenMismatch.php | Class | Class source |
exUnexpectedValue.php | Class | Class source |
exUserNotFound.php | Class | Class source |
Files (75) | / | src | / | Federation |
File | Role | Description | ||
---|---|---|---|---|
Command (4 files, 3 directories) | ||||
TokenProvider (2 files) | ||||
PlatformRest.php | Class | Class source |
Files (75) | / | src | / | Federation | / | Command |
File | Role | Description | ||
---|---|---|---|---|
Me (3 files) | ||||
Members (3 files) | ||||
Recover (2 files) | ||||
AccountInfo.php | Class | Class source | ||
ListAccountsInfo.php | Class | Class source | ||
Register.php | Class | Class source | ||
tTokenAware.php | Class | Class source |
Files (75) | / | src | / | Federation | / | Command | / | Me |
File | Role | Description |
---|---|---|
AccountInfo.php | Class | Class source |
ChangeIdentity.php | Class | Class source |
ChangePassword.php | Class | Class source |
Files (75) | / | src | / | Federation | / | Command | / | Members |
File | Role | Description |
---|---|---|
Exists.php | Class | Class source |
ValidateUserIdentifier.php | Class | Class source |
Whois.php | Class | Class source |
Files (75) | / | src | / | Federation | / | Command | / | Recover |
File | Role | Description |
---|---|---|
ResendCode.php | Class | Class source |
Validate.php | Class | Class source |
Files (75) | / | src | / | Federation | / | TokenProvider |
File | Role | Description |
---|---|---|
TokenFromOAuthClient.php | Class | Class source |
TokenInstanceFromOAuthClient.php | Class | Class source |
Files (75) | / | src | / | Grant |
File | Role | Description | ||
---|---|---|---|---|
Container (1 file) | ||||
Extension (1 file) | ||||
aGrantRequest.php | Class | Class source | ||
AuthorizeCode.php | Class | Class source | ||
ClientCredential.php | Class | Class source | ||
Implicit.php | Class | Class source | ||
Password.php | Class | Class source | ||
RefreshToken.php | Class | Class source |
Files (75) | / | src | / | Interfaces |
File | Role | Description |
---|---|---|
iAccessTokenEntity.php | Class | Class source |
iClientOfOAuth.php | Class | Class source |
iGrantAuthorizeRequest.php | Class | Class source |
iGrantTokenRequest.php | Class | Class source |
ipGrantRequest.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.