ASP.NET core SSO

Hi I’m trying to develop an 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/ 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.

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");
    }

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.

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