Formatting updates to the authorization classes.
This commit is contained in:
parent
25aeb2f9ab
commit
5507460870
@ -1,10 +1,8 @@
|
|||||||
using System.Threading.Tasks;
|
namespace eShopOnContainers.Core.Services.Identity
|
||||||
|
|
||||||
namespace eShopOnContainers.Core.Services.Identity
|
|
||||||
{
|
{
|
||||||
public interface IIdentityService
|
public interface IIdentityService
|
||||||
{
|
{
|
||||||
string CreateAuthorizeRequest();
|
string CreateAuthorizationRequest();
|
||||||
string CreateLogoutRequest(string token);
|
string CreateLogoutRequest(string token);
|
||||||
string DecodeToken(string token);
|
string DecodeToken(string token);
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,10 @@ namespace eShopOnContainers.Core.Services.Identity
|
|||||||
{
|
{
|
||||||
public class IdentityService : IIdentityService
|
public class IdentityService : IIdentityService
|
||||||
{
|
{
|
||||||
public string CreateAuthorizeRequest()
|
public string CreateAuthorizationRequest()
|
||||||
{
|
{
|
||||||
// Create URI to authorize endpoint
|
// Create URI to authorization endpoint
|
||||||
var authorizeRequest =
|
var authorizeRequest = new AuthorizeRequest(GlobalSetting.Instance.IdentityEndpoint);
|
||||||
new AuthorizeRequest(GlobalSetting.Instance.IdentityEndpoint);
|
|
||||||
|
|
||||||
// Dictionary with values for the authorize request
|
// Dictionary with values for the authorize request
|
||||||
var dic = new Dictionary<string, string>();
|
var dic = new Dictionary<string, string>();
|
||||||
@ -29,7 +28,6 @@ namespace eShopOnContainers.Core.Services.Identity
|
|||||||
dic.Add("state", currentCSRFToken);
|
dic.Add("state", currentCSRFToken);
|
||||||
|
|
||||||
var authorizeUri = authorizeRequest.Create(dic);
|
var authorizeUri = authorizeRequest.Create(dic);
|
||||||
|
|
||||||
return authorizeUri;
|
return authorizeUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,6 +51,7 @@ namespace eShopOnContainers.Core.Services.Identity
|
|||||||
string partToConvert = parts[1];
|
string partToConvert = parts[1];
|
||||||
partToConvert = partToConvert.Replace('-', '+');
|
partToConvert = partToConvert.Replace('-', '+');
|
||||||
partToConvert = partToConvert.Replace('_', '/');
|
partToConvert = partToConvert.Replace('_', '/');
|
||||||
|
|
||||||
switch (partToConvert.Length % 4)
|
switch (partToConvert.Length % 4)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -188,7 +188,7 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
|
|
||||||
await Task.Delay(500);
|
await Task.Delay(500);
|
||||||
|
|
||||||
LoginUrl = _identityService.CreateAuthorizeRequest();
|
LoginUrl = _identityService.CreateAuthorizationRequest();
|
||||||
|
|
||||||
IsValid = true;
|
IsValid = true;
|
||||||
IsLogin = true;
|
IsLogin = true;
|
||||||
@ -226,7 +226,7 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
Settings.AuthAccessToken = string.Empty;
|
Settings.AuthAccessToken = string.Empty;
|
||||||
Settings.AuthIdToken = string.Empty;
|
Settings.AuthIdToken = string.Empty;
|
||||||
IsLogin = false;
|
IsLogin = false;
|
||||||
LoginUrl = _identityService.CreateAuthorizeRequest();
|
LoginUrl = _identityService.CreateAuthorizationRequest();
|
||||||
}
|
}
|
||||||
else if (url.Contains(GlobalSetting.Instance.IdentityCallback))
|
else if (url.Contains(GlobalSetting.Instance.IdentityCallback))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user