# ASP.NET core SSO

**URL:** <https://forums.eveonline.com/t/asp-net-core-sso/33161>\
**Category:** Third Party Developers\
**Created:** [October 22, 2017, 3:39am UTC](https://forums.eveonline.com/t/asp-net-core-sso/33161 "2017-10-22T03:39:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grey-Walker](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/grey-walker/32/32170_2.png) [@Grey-Walker](https://forums.eveonline.com/u/Grey-Walker)\
**Post date:** [October 22, 2017, 3:39am UTC](https://forums.eveonline.com/t/asp-net-core-sso/33161/1 "2017-10-22T03:39:17Z")

</div>

Hi I’m trying to develop an [ASP.Net](http://ASP.Net) core web application using a Nuget package called EVE Online SingleSignOnCore its available through the Nuget package manger and located here [https://gitlab.com/baldvinth/EVE.SingleSignOn.Core/](https://gitlab.com/baldvinth/EVE.SingleSignOn.Core/) I can authenticate a user and redirect to the callback page.

```
public RedirectResult AuthenticateWithEve()
{            
   var ssoSettings = new SsoSettings();
   ssoSettings.BaseUrl = "https://login.eveonline.com/";
   ssoSettings.CallbackUrl = "http://localhost:5992/Home";
   ssoSettings.Scope = "publicData";
   ssoSettings.ClientId = "Blegh";
   ssoSettings.ClientSecret = "Blegh";
   ssoSettings.ContactEmail = "test@tester34.com";

   var SingleSignOnClient = new SingleSignOnClient(ssoSettings);
        
   var url = SingleSignOnClient.GetAuthenticationUrl();

   return Redirect(url);
}

```

After this I’m at a lose on how to use the package to get charcterID, refresh tokens etc, has anyone here used this Nuget package before or might be able to give an example of its usage.

many thanks.

---

<div class="post-metadata">

**Author:** ![Phrynohyas\_Tig-Rah](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/phrynohyas_tig-rah/32/420039_2.png) [@Phrynohyas\_Tig-Rah](https://forums.eveonline.com/u/Phrynohyas_Tig-Rah)\
**Post date:** [October 22, 2017, 7:52am UTC](https://forums.eveonline.com/t/asp-net-core-sso/33161/2 "2017-10-22T07:52:04Z")

</div>

There is a sample in the readme of this repository:

```
    public async Task<IActionResult> Callback(string code)
    {
        // Validate the code we just received
        // The response data should be stored somehow (authentication cookie / .net core identity)
        // https://docs.microsoft.com/en-us/aspnet/core/security/authentication/cookie?tabs=aspnetcore2x
        SsoResponse authentication = await _sso.AuthenticateAsync(code);

        // Information in SsoResponse includes a refresh token if any scope was requested
        // To refresh information, just pass the refresh token to the RefreshAsync method
        // Example: SsoResponse refresh = await _sso.RefreshAsync(authentication.RefreshToken);

        // Use the access token to get information about the character that logged in
        SsoCharacter character = await _sso.VerifyAsync(authentication.AccessToken);

        // OPTIONAL: Redirect to a specific location as specified in Login step
        return RedirectToAction("Index", "Home");
    }
```

---

<div class="post-metadata">

**Author:** ![Grey-Walker](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/grey-walker/32/32170_2.png) [@Grey-Walker](https://forums.eveonline.com/u/Grey-Walker)\
**Post date:** [October 22, 2017, 12:43pm UTC](https://forums.eveonline.com/t/asp-net-core-sso/33161/3 "2017-10-22T12:43:26Z")

</div>

Hi Phrynohyas Tig-Rah thanks for taking the time to reply, the developoer of the Nuget package posted that when I reached out to him to post a usage of the code.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [January 20, 2018, 12:43pm UTC](https://forums.eveonline.com/t/asp-net-core-sso/33161/4 "2018-01-20T12:43:51Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
