public OAuth2Message Issue(string securityTokenServiceUrl, OAuth2AccessTokenRequest oauth2Request)
        {
            OAuth2WebRequest oAuth2WebRequest = new OAuth2WebRequest(securityTokenServiceUrl, oauth2Request);
            OAuth2Message    result;

            try
            {
                System.Net.WebResponse response = oAuth2WebRequest.GetResponse();
                result = OAuth2MessageFactory.CreateFromEncodedResponse(new System.IO.StreamReader(response.GetResponseStream()));
            }
            catch (System.Exception innerException)
            {
                throw new System.Exception("Token request failed.", innerException);
            }
            return(result);
        }
 public static OAuth2Message CreateFromEncodedResponse(System.IO.StreamReader reader)
 {
     return(OAuth2MessageFactory.CreateFromEncodedResponse(reader.ReadToEnd()));
 }