OauthController
Summary
Defines a controller to handle requests relative to Web Service authentication.
Constructor
OauthController
Syntax
OauthController
()
Summary
Item Index
Methods
- getPermissionIds static
- getScopeByUrl static
- validateScopesAction
Methods
getPermissionIds
Syntax
Summary
Retrieves, recursively, the id of all permissions.
Parameters:
-
permissions
ArrayThe list of permissions to search in
Returns:
Array:
The list of permission ids
Example:
var permissions = [
{
label: 'Permissions group',
permissions: [
{
id: 'perm-1',
name: 'Name of the first permission',
description: 'Description of the first permission',
paths: [ 'get /path1' ]
}
]
},
{
id: 'perm-2',
name: 'Name of the second permission',
description: 'Description of the second permission',
paths: [ 'get /path2' ]
}
];
getPermissionIds(permissions); // ["perm-1", "perm-2"]
getScopeByUrl
Syntax
Summary
Retrieves, from list of scopes, the scope corresponding to the couple url / http method.
Returns:
String:
The scope id if found, null otherwise
validateScopesAction
Syntax
validateScopesAction
(
-
request
-
response
-
next
Summary
Validates scopes for the given token depending on requested url.
Revoke access to the service if client does not have permission.