mirror of
https://github.com/bitwarden/server.git
synced 2025-05-29 15:24:51 -05:00
Move idenityserver implementations into API project
This commit is contained in:
parent
1e16644f52
commit
3348b07ce2
@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
|
||||||
namespace Bit.Core.Identity
|
namespace Bit.Api.IdentityServer
|
||||||
{
|
{
|
||||||
public class ApiResources
|
public class ApiResources
|
||||||
{
|
{
|
@ -1,7 +1,7 @@
|
|||||||
using IdentityServer4.Models;
|
using IdentityServer4.Models;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Bit.Core.Identity
|
namespace Bit.Api.IdentityServer
|
||||||
{
|
{
|
||||||
public class Clients
|
public class Clients
|
||||||
{
|
{
|
@ -7,7 +7,7 @@ using Bit.Core.Repositories;
|
|||||||
using IdentityServer4.Models;
|
using IdentityServer4.Models;
|
||||||
using IdentityServer4.Stores;
|
using IdentityServer4.Stores;
|
||||||
|
|
||||||
namespace Bit.Core.Identity
|
namespace Bit.Api.IdentityServer
|
||||||
{
|
{
|
||||||
public class PersistedGrantStore : IPersistedGrantStore
|
public class PersistedGrantStore : IPersistedGrantStore
|
||||||
{
|
{
|
@ -4,7 +4,7 @@ using IdentityServer4.Models;
|
|||||||
using Bit.Core.Repositories;
|
using Bit.Core.Repositories;
|
||||||
using Bit.Core.Services;
|
using Bit.Core.Services;
|
||||||
|
|
||||||
namespace Bit.Core.Identity
|
namespace Bit.Api.IdentityServer
|
||||||
{
|
{
|
||||||
public class ProfileService : IProfileService
|
public class ProfileService : IProfileService
|
||||||
{
|
{
|
@ -1,5 +1,6 @@
|
|||||||
using Bit.Core.Domains;
|
using Bit.Core.Domains;
|
||||||
using Bit.Core.Enums;
|
using Bit.Core.Enums;
|
||||||
|
using Bit.Core.Exceptions;
|
||||||
using Bit.Core.Repositories;
|
using Bit.Core.Repositories;
|
||||||
using IdentityServer4.Models;
|
using IdentityServer4.Models;
|
||||||
using IdentityServer4.Validation;
|
using IdentityServer4.Validation;
|
||||||
@ -10,7 +11,7 @@ using System;
|
|||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Bit.Core.Identity
|
namespace Bit.Api.IdentityServer
|
||||||
{
|
{
|
||||||
public class ResourceOwnerPasswordValidator : IResourceOwnerPasswordValidator
|
public class ResourceOwnerPasswordValidator : IResourceOwnerPasswordValidator
|
||||||
{
|
{
|
||||||
@ -66,7 +67,8 @@ namespace Bit.Core.Identity
|
|||||||
}
|
}
|
||||||
|
|
||||||
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
|
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
|
||||||
twoFactorRequest ? "Code is not correct. Try again." : "Username or password is incorrect. Try again.");
|
twoFactorRequest ? "Code is not correct. Try again." : "Username or password is incorrect. Try again.",
|
||||||
|
new System.Collections.Generic.Dictionary<string, object> { { "Error", true } });
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> TwoFactorRequiredAsync(User user)
|
private async Task<bool> TwoFactorRequiredAsync(User user)
|
@ -2,7 +2,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Bit.Core.Identity
|
namespace Bit.Api.IdentityServer
|
||||||
{
|
{
|
||||||
public static class TokenRetrieval
|
public static class TokenRetrieval
|
||||||
{
|
{
|
@ -29,6 +29,7 @@ using IdentityServer4.Stores;
|
|||||||
using Bit.Core.Utilities;
|
using Bit.Core.Utilities;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
|
using Bit.Api.IdentityServer;
|
||||||
|
|
||||||
namespace Bit.Api
|
namespace Bit.Api
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,9 @@
|
|||||||
"Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
|
"Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
|
||||||
"AspNetCoreRateLimit": "1.0.5",
|
"AspNetCoreRateLimit": "1.0.5",
|
||||||
"Serilog.Extensions.Logging": "1.3.1",
|
"Serilog.Extensions.Logging": "1.3.1",
|
||||||
"Serilog.Sinks.AzureDocumentDb": "3.5.17"
|
"Serilog.Sinks.AzureDocumentDb": "3.5.17",
|
||||||
|
"IdentityServer4": "1.0.1",
|
||||||
|
"IdentityServer4.AccessTokenValidation": "1.0.2"
|
||||||
},
|
},
|
||||||
|
|
||||||
"tools": {
|
"tools": {
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
"Sendgrid": "6.3.4",
|
"Sendgrid": "6.3.4",
|
||||||
"PushSharp": "4.0.10",
|
"PushSharp": "4.0.10",
|
||||||
"WindowsAzure.Storage": "8.0.0",
|
"WindowsAzure.Storage": "8.0.0",
|
||||||
"IdentityServer4": "1.0.1",
|
|
||||||
"IdentityServer4.AccessTokenValidation": "1.0.2",
|
|
||||||
"Otp.NET": "1.0.0"
|
"Otp.NET": "1.0.0"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user