Hai Suresh, Prabath,

                            In the identity.oauth - 4.0.5 component throws
the above exception when return the generated access token from
TokenIssuer.issue().

(1)
Exception: org.apache.axis2.AxisFault:
org.apache.axis2.databinding.ADBException: Unexpected subelement {
http://dto.oauth2.identity.carbon.wso2.org/xsd}expiresInMillis
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at
org.wso2.carbon.identity.oauth2.stub.OAuth2ServiceStub.fromOM(OAuth2ServiceStub.java:1252)
at
org.wso2.carbon.identity.oauth2.stub.OAuth2ServiceStub.issueAccessToken(OAuth2ServiceStub.java:481)


Solution: In the OAuthAccessTokenRespDTO has expiresIn(sec) as well as
expiresinmillis properties. When the token is generated we set the
expiresin(sec) only. expiresinmillis just multiplies the expiresin * 1000.
After I commented the expiresinmillis property at the above class it works
fine / No exception. The access token is returned and displayed. Able to
access the REST API.

(2) Currently, When the app get registered the client ID/ secret
/username/tenentid ...etc are set through the OAuthAppDO. But when retrieve
the stored app, we retrieve OAuthAppDO does not include the username(authz
user). Bz currently, The "GET_APP_INFO" query string defined at the
SqlQueries.java at the identity.oauth.dao does not retrieve the username of
the authorized user instead it retrieves the cliend id/secret/appname/.

Solution: I have added a new query includes the username retrieval as well.
Otherwise we are unable to set the authzUser property of the
TokenRequestMessageContext object which is used to generates the
AccessToken. With the OLD query if I invoke the
accessTokenValidationResponse.getAuthorizedUser() returns null. But it
works fine with the NEW QUERY and I was able to create the user registry
instance with username. With the old query It does not create the user
registry instance and REST calls were failed.

(3) Hai suresh, We can also retrieve the TenanID of the authzuser via
OAuthAppDo. If we define a property to get/set the tenentID at the
tokenReqMsgContext, we can retrieve the tenantID from the
AccessTokenValidationResponse object. Therefore we can create user registry
instance with (username, tenantID).

WDYT?

Thanks!
Sriragu
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to