Issued by DNOA service access token parsing and validating in Java application
- by Regfor
I am creating OAuth 2.0 access token using DotNetOpenAuth, like here
public AccessTokenResult CreateAccessToken(
IAccessTokenRequest accessTokenRequestMessage)
{
var token = new AuthorizationServerAccessToken();
token.Lifetime = TimeSpan.FromMinutes(10);
var signCert = LoadCert(Config.STS_CERT);
token.AccessTokenSigningKey =
(RSACryptoServiceProvider) signCert.PrivateKey;
var encryptCert = LoadCert(Config.SERVICE_CERT);
token.ResourceServerEncryptionKey =
(RSACryptoServiceProvider) encryptCert.PublicKey.Key;
var result = new AccessTokenResult(token);
return result;
}
Token issued by this method looks like:
{
"access_token": "gAAAAH44atDAyWeu8BFwhLof7rtBRpiZrSlAC0zci8xU81tXHZDVkBX8LXrMLDHDYfimjuSOsdrXQIAY7Xf4JnK1x_fo_JSmvuiA5CvO5JUJNuEmHNSlR4ePO4tBPkOHQnN50DIRJMbHJdQrFZCqqaWz6s0iuvCuTMcTua6J0yaTPQaD9AAAAIAAAADHgef78SHh4-K2aZ87xYRoRFfmQ0lc3ET7Y5vAS7BadLM5btYvmrSkAWsCxhUji92D0LbKgyVkbQuuw5LnRP_zsxe_W_VztTqZ5m9PwJDL6q7McrUfiVQj_XBQqpv2slBeouD0F1k1KjVedR9Pwm7ganz4R7dmeYivnx8f0_isEGBqSZrtnILoit3SOCPyVxmIwizYwLE2bQOtlwVpqtrBMyzc4MVPVyaSiJb2-Lj5tOftEWl0k93Qmr8uzmjDyeCn3TsFX0f_qFgCmxp32_kt4ZTMf4zgmh5yUS1Hy7ERNQxpCIxRTx9yma7JN_K5Pss",
"token_type": "bearer",
"expires_in": 43200,
}
I need to know whether Java application will be able to parse and validate token issued in such manner?