2017-03-29 30 views
0

我正在使用WSO2 Identity Server作爲我們網站的身份提供程序。這些網站正在ASP.net中開發,我們正在使用內置的Owin-Katana框架和Oauth 2來驗證用戶身份。我可以訪問SCIM REST Api來創建新的用戶和他們對WSO2的聲明。索賠是在方言「urn:scim:schemas:core:1.0」下添加的。我需要在通過Oauth 2驗證用戶身份時檢索這些聲明。服務提供商設置不允許我從方言「urn:scim:schemas:core:1.0」中選擇聲明。與Oauth2一起使用時,未從WSO2身份服務器(v5.1.0)接收聲明

有沒有一種方法可以檢索我添加給用戶的聲明?這裏的answer建議我們安裝WSO2的升級版本。這是唯一的解決方案嗎?

我Owin設置是(使用NuGet包Owin.Security.Providers.WSO2):

app.UseWSO2Authentication(new WSO2AuthenticationOptions() 
{ 
    BaseUrl = "https://identityserver:9443/",     
    CallbackPath = new PathString("/Account/ExternalLoginConfirmation"), 
    ClientId = "xxxxxxxxx", 
    ClientSecret = "yyyyyyyyy" 
}); 

回答

0

您可以檢索通過SCIM API用戶的索賠。 GET請求的

實施例:

捲曲-X GET -H 「授權:基本(base64 adminUsername:adminPassword)」, 「https://開頭ishostismgtport/WSO2/SCIM /用戶過濾= userNameEq userstoredomain/userId」?

{ 
    "schemas": [ 
    "urn:scim:schemas:core:1.0", 
    "urn:scim:schemas:extension:wso2:1.0" 
    ], 
    "totalResults": 1, 
    "Resources": [ 
    { 
     "wso2Extension": { 
     "nodeId": "2800", 
     "employeeNumber": "TEST01" 
     }, 
     "id": "e8a1791f-af81-4d61-ad33-51fd80c4d716", 
     "roles": [ 
     "STORE_MANAGER" 
     ], 
     "name": { 
     "familyName": "Manager", 
     "givenName": "Mr" 
     }, 
     "userName": "userstoredomain/userId", 
     "phoneNumbers": [ 
     "0000000000" 
     ], 
     "externalId": "1_TEST01", 
     "meta": { 
     "lastModified": "2017-03-27T14:33:05", 
     "created": "2017-03-27T14:33:05", 
     "location": "https://localhost:9443/wso2/scim/Users/e8a1791f-af81-4d61-ad33-51fd80c4d716" 
     } 
    } 
    ] 
} 

https://docs.wso2.com/display/IS510/SCIM+APIs

上面examp le通過版本5.0.0檢索

+0

是的,我可以做,這將是我最後的手段。但我想使用OAuth2協議並將索賠作爲驗證結果的一部分。 – TejSoft

0

如點1所示在this link中,您需要選擇在「http://wso2.org/oidc/claim」方言與「http://wso2.org/claims」方言之間具有映射關係的聲明。

從每個聲明的映射屬性值中檢查映射。在http://wso2.org/oidc/claim方言中的電子郵件聲明和在http://wso2.org/claims方言中的電子郵件聲明具有Mapped屬性作爲郵件,請嘗試將郵件屬性映射到urn:scim:schemas:core:1.0方言中所需的聲明。在服務提供商請求索賠時,請求具有映射屬性值的http://wso2.org/oidc/claim方言索賠。

希望這會有所幫助。