Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding Claims

I'm trying to get up to speed with OpenId Connect, OAuth2.0, Security Token Service and Claims. Imagine a scenario with a large website with many areas and different functionality e.g. Customer, Order, Supplier, Delivery, Returns etc. My question is this – would I create Claims on the Token Server such as CanCreateCustomer, CanReadCustomer, CanUpdateCustomer, CanDeleteCustomer etc, i.e. effectively CRUD Claims for each main area/Business Object? This would lead to many tens but more likely hundreds of Claims. Or is my understanding coming up short?

like image 914
David Avatar asked May 06 '16 08:05

David


People also ask

What is claim and how does it work?

Following a loss, the policyholder can ask their insurance company to pay them for what they've lost. This request is called a claim. The purpose of insurance is to bring the insured back to the same financial state they were in immediately before a loss. This process is known as indemnification.

What is the importance of claim?

The claim defines what the author wants you to do, think, or believe by the time you finish reading his or her work. Your claim is your thesis assertion, or angle. In logical argument, your argument is only as valuable as its claim, which needs to be detailed, reasonable, and supportable with valid evidence.

What is the process of claim?

In essence, claims processing refers to the insurance company's procedure to check the claim requests for adequate information, validation, justification and authenticity. At the end of this process, the insurance company may reimburse the money to the healthcare provider in whole or in part.


2 Answers

So fixing terminology, you mean "scopes", not "claims". Scopes are identifiers used to specify what access privileges are being requested. Claims are name/value pairs that contain information about a user.

So an example of a good scope would be "read_only". Whilst an example of a claim would be "email": "[email protected]".

You can send claims in the id token (or JWT), or/and have them available via the userinfo endpoint (if using the "openid" scope).

You can break scopes down per service, and have them as granule as you would like. Or have them as high level (read / write / admin). I would recommend having enough scopes to actively achieve the security principle of least privilege (basically: giving people what they need to do their job). You can use namespaces if you have a lot of scopes.

like image 87
Jordan Stewart Avatar answered Jan 06 '23 08:01

Jordan Stewart


Your understanding is right, but you have a lot more flexibility in OAuth2.0 scopes (claims)

These scopes can be configured in any way for eg, in your case instead of creating individual scopes for each CRUD operation for each main area, you could create group scopes like

customer.read_write
order.read_write 

Etc, you can even go one level higher , by creating functionality level scopes, like

webportal.full_access
adminportal.full_access

Then in your application, after authentication, the authorisation can be done like,

ValidScopesIn({Scopes.WEBPORTAL_FULL_ACCESS, Scopes.CUSTOMER_READ_WRITE})
public void createCustomer(Customer customer) {
// your creation logic 
}
like image 43
Ramesh Lingappa Avatar answered Jan 06 '23 09:01

Ramesh Lingappa