Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between scope and authority in UAA

In UAA There are two Concepts, Authority and Scope.

These concepts seems to overlap. I would like to know exact difference and purpose

For example , oauth.login

like image 995
Yogesh Sajanikar Avatar asked Feb 29 '16 02:02

Yogesh Sajanikar


People also ask

What is scope in authorization?

Scopes allow you to limit your application's access to user data and to the V3 API endpoints. When your application requests a user's permission to access their data, Constant Contact uses authorization scopes to determine what information your application needs.

What is UAA in PCF?

User Account and Authentication (UAA) is an open-source identity server project under the Cloud Foundry Foundation. UAA provides enterprise-scale identity management features.

How do I get my UAA access token?

Obtaining Tokens Using Authorization Code Grant When you use the authorization code grant type, the client directs the resource owner to UAA, which in turn directs the resource owner back to the client with the authorization code. The OAuth2 endpoint in UAA accepts authorization code to provide an Access Token.

What is a UAA token?

Overview. The primary role of UAA is as an OAuth2 provider, issuing tokens for client apps to use when they act on behalf of Cloud Foundry users. In collaboration with the login server, UAA can authenticate users with their Cloud Foundry credentials, and can act as an SSO service using those, or other, credentials.


Video Answer


2 Answers

Scopes are permissions of an OAuth Client acting on behalf of a User. They are granted after obtaining a user token with one of the following grant types: auth_code, password, implicit. Scopes signify what the application is allowed to access on User's behalf (referred to as delegated authorisation).

Authorities are permissions of an OAuth Client acting on its own behalf and there is no User involvement. They are granted after obtaining a client token with grant_type of client_credentials. Typical use is an Application or API trying to access a resource with its own credentials without user involvement.

In UAA , oauth.login is a system level permission and was being used by the legacy implementation of the login-server project (When UAA and Login Server were separate components). This permission allows admin level access for login server.

like image 131
Sree Tummidi Avatar answered Oct 04 '22 21:10

Sree Tummidi


1) authorities and roles are spring-security wording for permissions. It is not defined in OAuth2 specs.

2) scopes are defined by OAuth2. It is intended to define what the end-user allowed each client to do on its behalf (information from authorization-server to resource-servers).

As a consequence, authorities granted to a client should always be a subset of end-user ones : all possible scopes => all of user authorities ; the less scopes, the less authorites.

One trick, on "client" OAuth2 flow, the client is the end-user => scopes make no sense in that case (the client is not authenticating on behalf of someone, but in its own name).

Default OAuth2 spring-security converters turn scopes into authorities. To me this introduces a lot of confusion and should not happen. Scope claim should instead be used to filter end-user authorities.

Latest requires to write and configure your own authorities converter which is already possible for JWT but not yet for introspection (should come, a ticket is opened for that)

Also, nothing in OAuth2 specs requires permissions (spring authorities and roles) to be contained (using a private claim) in the token or managed by the authorization-server. It is legit for a resource server to retrieve it for instance from a database using the subject claim and then "scope" it (filter end-user authorities according to the scopes granted to the client).

like image 31
ch4mp Avatar answered Oct 04 '22 23:10

ch4mp