Implicit Flow

The implicit grant type is used to obtain access tokens (it does not support the issuance of refresh tokens) and is optimized for public clients known to operate a particular redirection URI. These clients are typically implemented in a browser using a scripting language such as JavaScript.

More Details

How to Use in PHP

1) Create App in Cidaas

To work with implicit flow we need to create Browser based application in cidaas app section

2) Get Access Token

In this example I am going to use Cidaas/oauth2-cidaas-php . for more library please visit

$provider = new Cidaas([
    'baseUrl'                 => 'yourcidaasbaseurl',
    'clientId'                => 'xxxx',    // The client ID assigned to you by the provider
    'clientSecret'            => 'yyyy',   // The client password assigned to you by the provider
    'redirectUri'             => 'https://yourredirecturl'


This code will give you the autherization url. redirect to the browser with this URL. Once the User logged in to the account , cidaas will redirect to the redirect_uri with the hash of access_token and expire_in



3) Get User info

Once you got the access_token pass the access_token to cidaas user info url.

echo "Copy Paste the above URL in the browser and login and Enter the Access Token : ";
$handle = fopen ("php://stdin","r");
$line = fgets($handle);

$accessToken2 = new AccessToken(["access_token" => trim($line)]);
$resourceOwner = $provider->getResourceOwner($accessToken2);

User info format
  "id": "id",
  "provider": "Provider",
  "ssoId": "ssoid",
  "username": "",
  "email": "",
  "mobile": "+919738122401",
  "firstname": "vimal",
  "lastname": "prakash",
  "displayName": "vimal prakash",
  "createTime": 1476957466236,
  "active": true,
  "emailVerified": true,
  "mobileNoVerified": false,
  "smsNotificationEnabled": false,
  "googleAuthenticatorEnabled": false,
  "currentLocale": "en_US",
  "userStatus": "VERIFIED",
  "identityJRString": null,
  "customFields": {
    "groupid": "",
    "Title": "",
    "Gender": "",
    "DateofBirth": "",
    "Salutation": ""
  "roles": [
  "twofactorenabled": false,
  "lastLoggedTime": 1500231552247,
  "lastUsedSocialIdentity": null,
  "photoURL": null,
  "usedProviders": null,
  "customFieldWithMetadata": {
    "groupid": {
      "dataType": "Text",
      "value": "",
      "internal": true,
      "readOnly": false
    "Title": {
      "dataType": "Text",
      "value": "",
      "internal": true,
      "readOnly": false
    "Gender": {
      "dataType": "Text",
      "value": "",
      "internal": true,
      "readOnly": false
    "DateofBirth": {
      "dataType": "Text",
      "value": "",
      "internal": true,
      "readOnly": false
    "Salutation": {
      "dataType": "Text",
      "value": "",
      "internal": true,
      "readOnly": false
  "groups": null

results matching ""

    No results matching ""