Added userinfo endpoint usage and api now properly creates necessary claims to start doing database stuff

This commit is contained in:
2021-10-18 11:06:44 -04:00
parent 320d939c76
commit 9e6c7f33a5
13 changed files with 129 additions and 88 deletions

View File

@@ -0,0 +1,34 @@
using Newtonsoft.Json;
namespace WebAPI.Data.Dto.OIDC
{
public class OIDCUserInfoResponse
{
[JsonProperty("email")]
public string Email { get; set; }
[JsonProperty("email_verified")]
public bool EmailVerified { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("given_name")]
public string GivenName { get; set; }
[JsonProperty("family_name")]
public string FamilyName { get; set; }
[JsonProperty("preferred_username")]
public string PreferredUsername { get; set; }
[JsonProperty("nickname")]
public string Nickname { get; set; }
[JsonProperty("groups")]
public string[] Groups { get; set; }
[JsonProperty("sub")]
public string Sub { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using Newtonsoft.Json;
namespace WebAPI.Data.Dto
{
public class PterodactylCreateUserRequest
{
public string Email { get; set; }
public string Username { get; set; }
[JsonProperty("external_id")]
public string ExternalId { get; set; }
[JsonProperty("first_name")]
public string FirstName { get; set; }
[JsonProperty("last_name")]
public string LastName { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
namespace WebAPI.Data.Dto
{
public class PterodactylCreateUserResponseAttributes
{
public int Id { get; set; }
}
public class PterodactylCreateUserResponse
{
public PterodactylCreateUserResponseAttributes Attributes { get; set; }
}
}