Asp.net integration code for ORCID authorization

58 views
Skip to first unread message

Muhammed Ashraf

unread,
Jan 17, 2019, 10:05:38 AM1/17/19
to ORCID API Users

r.bla...@orcid.org

unread,
Jan 17, 2019, 11:28:32 AM1/17/19
to ORCID API Users
Hi Muhammed ,

You post seems to have no content. Could you try posting again?

Thanks 

On Thursday, January 17, 2019 at 3:05:38 PM UTC, Muhammed Ashraf wrote:

Muhammed Ashraf

unread,
Jan 19, 2019, 11:05:35 PM1/19/19
to ORCID API Users
can i have the example asp.net code for ORCID api call?

Liz Krznarich

unread,
Jan 20, 2019, 12:10:18 PM1/20/19
to orcid-a...@googlegroups.com
Hi Muhammed, 

We're not aware of very many integrations using ASP.NET, however, there is a small code sample on http://members.orcid.org/api/resources/code-examples
If any other group members are using ORCID in ASP.NET , any tips you could offer would be helpful!

Cheers,
Liz
---
Liz Krznarich 
Tech Lead, ORCID
http://orcid.org/0000-0001-6622-4910


Pedro Nuno Sabugueiro Oliveira

unread,
Feb 12, 2019, 7:15:21 AM2/12/19
to ORCID API Users
something like this?

private static IRestResponse<Orcid> GetAuthorisationResponse(string code)
{
    var clientId = ConfigurationManager.AppSettings.Get("ClientId");
    var clientSecret = ConfigurationManager.AppSettings.Get("ClientSecret");
    var redirect_uri = ConfigurationManager.AppSettings.Get("RedirectUri") + "/orcid.aspx";
    var client = new RestClient("https://orcid.org/oauth/token");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Accept""application/json");
    request.AddHeader("Content-type""application/x-www-form-urlencoded");
    request.AddParameter("client_id", clientId);
    request.AddParameter("client_secret", clientSecret);
    request.AddParameter("scope""/read-public");
    request.AddParameter("grant_type""authorization_code");
    request.AddParameter("code", code);
    request.AddParameter("redirect_uri", redirect_uri);
    IRestResponse<Orcid> response = client.Execute<Orcid>(request);
    return response;
}
Reply all
Reply to author
Forward
0 new messages