Janier
Janier

Reputation: 4412

How to set scope for a user/role in WSO2 Identity Server?

In WSO2 Identity Server , I tried to associate scope with roles/users so that I can authorize them the access to API's if the scopes match. But no place i can see that. I am using node js in my back end.

I want to achieve something like below app.get('/deleteUser', authenticate({scope:'admin'}), function(req,res){

So that only those users[tokens] having the scopes 'admin' should be able to access deleteUser .How to achieve this user/role mapping to scope in WSO2 Identity server?

Upvotes: 1

Views: 932

Answers (2)

drox
drox

Reputation: 8233

WSO2 Identity Server doesn't have a scope validation logic by default. You will have to customize using OAuthScopeValidator

As @Jenananthan has already pointed out, WSO2 API Manager could be used for your use case.

Upvotes: 1

Jenananthan
Jenananthan

Reputation: 1401

I am not sure whether wso2 identity server support user/role mapping to scope. But for your use case I think you can use wso2 apimanager which handle role mapping with scope http://nuwanzone.blogspot.com/2014/06/oauth-20-scopes-with-wso2-api-manager.html

Upvotes: 2

Related Questions