I am using DotNetOpenAuth libraries to implement OAuth 2.0 client side to communicate with SalesForce authorization server. I have finished first two steps of OAuth 2.0 communication that ends with obtaining of access token from SalesForce authorization server.
When I get authentication response from SF with access token I can not find Id, that should contain full URL address to the specific user details. I am missing something ?
Here it is the URL from the http header when I have been redirected back from SF to the consumer application :
GET /Account/RegisterSalesForcelLogin.aspx?code=aPrxMZkm7lCkgfRmFY90tEF1_Wk_Fn0IN6iDVcy3u6joOHoaEdOP9NiQcHvbQT71SJhh0zWPiQ%3D%3D&state=Ot88XPwqvlsK-yE0zrrFmw HTTP/1.1
In code, I am consuming AuthorizationState object from DotNetOpenAuth libraries after authorization response is received. It does not contain extra data except access token, refresh token, etc. When I go deeper in their code I saw that initial response from SF does not contains extra data, not at all.
Here is the code for sending initial code to SalesForce :
public void InitCall()
{
AuthorizationServerDescription authServerDescription = new AuthorizationServerDescription();
authServerDescription.AuthorizationEndpoint = new Uri(@"https://login.salesforce.com/services/oauth2/authorize");
authServerDescription.TokenEndpoint = new Uri(@"https://login.salesforce.com/services/oauth2/token");
authServerDescription.ProtocolVersion = ProtocolVersion.V20;
WebServerClient newClient = new WebServerClient(authServerDescription, clientID, clientSecret);
//newClient.ClientCredentialApplicator = ClientCredentialApplicator.PostParameter(clientSecret);
var uri = "https://sfconsumer.com:50002/Account/RegisterSalesForcelLogin.aspx";
IEnumerable<string> scopes = new List<string> { "id", "web", "api", "refresh_token" };
client.RequestUserAuthorization(scopes, new Uri(uri));
}