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