1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-28 06:44:50 -05:00

Move idenityserver implementations into API project

This commit is contained in:
Kyle Spearrin 2017-01-18 18:34:14 -05:00
parent 1e16644f52
commit 3348b07ce2
9 changed files with 13 additions and 10 deletions

View File

@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Security.Claims;
namespace Bit.Core.Identity
namespace Bit.Api.IdentityServer
{
public class ApiResources
{

View File

@ -1,7 +1,7 @@
using IdentityServer4.Models;
using System.Collections.Generic;
namespace Bit.Core.Identity
namespace Bit.Api.IdentityServer
{
public class Clients
{

View File

@ -7,7 +7,7 @@ using Bit.Core.Repositories;
using IdentityServer4.Models;
using IdentityServer4.Stores;
namespace Bit.Core.Identity
namespace Bit.Api.IdentityServer
{
public class PersistedGrantStore : IPersistedGrantStore
{

View File

@ -4,7 +4,7 @@ using IdentityServer4.Models;
using Bit.Core.Repositories;
using Bit.Core.Services;
namespace Bit.Core.Identity
namespace Bit.Api.IdentityServer
{
public class ProfileService : IProfileService
{

View File

@ -1,5 +1,6 @@
using Bit.Core.Domains;
using Bit.Core.Enums;
using Bit.Core.Exceptions;
using Bit.Core.Repositories;
using IdentityServer4.Models;
using IdentityServer4.Validation;
@ -10,7 +11,7 @@ using System;
using System.Security.Claims;
using System.Threading.Tasks;
namespace Bit.Core.Identity
namespace Bit.Api.IdentityServer
{
public class ResourceOwnerPasswordValidator : IResourceOwnerPasswordValidator
{
@ -66,7 +67,8 @@ namespace Bit.Core.Identity
}
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)

View File

@ -2,7 +2,7 @@
using System;
using System.Linq;
namespace Bit.Core.Identity
namespace Bit.Api.IdentityServer
{
public static class TokenRetrieval
{

View File

@ -29,6 +29,7 @@ using IdentityServer4.Stores;
using Bit.Core.Utilities;
using Serilog;
using Serilog.Events;
using Bit.Api.IdentityServer;
namespace Bit.Api
{

View File

@ -22,7 +22,9 @@
"Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
"AspNetCoreRateLimit": "1.0.5",
"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": {

View File

@ -8,8 +8,6 @@
"Sendgrid": "6.3.4",
"PushSharp": "4.0.10",
"WindowsAzure.Storage": "8.0.0",
"IdentityServer4": "1.0.1",
"IdentityServer4.AccessTokenValidation": "1.0.2",
"Otp.NET": "1.0.0"
},