I want to remove/disable the [Required] attribute for "Password" field in IdentityUserCreateDto
It seems could not achieve it so I disabled the validation by putting [DisableValidation] in the CreateAsync method, but it does not work:
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IdentityUserController))]
public class CustomIdentityUserController : IdentityUserController
{
public CustomIdentityUserController(IIdentityUserAppService userAppService) : base(userAppService)
{
}
[DisableValidation]
public override Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input)
{
return UserAppService.CreateAsync(input);
}
}
Any advice woule be appreciated much, thank you.
Hi, I am using abp version 3.3.2 and could not find LDAP setting in the 'Account' section
I checked the release notes, it has been released on 3.1:
https://docs.abp.io/en/commercial/latest/release-notes
Is there any required step to enable it, I could not find it in this article:
https://github.com/abpio/abp-commercial-docs/blob/dev/en/modules/account/ldap.md
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
Hi, We have created a identity server client with grant type = client_credentials to let another application retrieving our data, now we create another tenant but dont know how to grant access for this client to access new tenant data, the "Identity Server -> Clients" does not appear if I login as tenant admin. any help would be much appreciated.
Hi, I see the connection string option "MultipleActiveResultSets=true" is put in a lot of articles in documentation but it does not appear in the connection string topic https://docs.abp.io/en/abp/latest/Connection-Strings
Is it required and if yes may I know which functions require it?
Hi, I have configured application to login with external authentication provider, the login is successful but security log does not capture the record, I also tried with Google authentication provider, has the same issue. Could you help us take a look. Thank you.
Hi, I have a requirement to log in with an external authentication provider named "Singpass", the spec & flow are described at the link below:
https://stg-id.singpass.gov.sg/docs/authorization/api#_introduction
Instead of redirect to authentication provider login page, it's using an embedded JS to generate the QR code in our page and require user to use mobile app to scan it for authentication, it requires to provide the state & nonce parameters as the input for embedded JS:
4.2. Input Parameters https://stg-id.singpass.gov.sg/docs/embedded-auth/js#_login_ui_dimensions
I have created an endpoint to manually generate the state & nonce parameters as below:
private readonly IOptionsMonitor<OpenIdConnectOptions> _openIdOptions;
...
private string GenerateNonce()
{
return Convert.ToBase64String(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString()));
}
public string GetState()
{
var state = GenerateNonce();
AuthenticationProperties authProperties = new AuthenticationProperties
(
new Dictionary<string, string>
{
{ OpenIdConnectDefaults.UserstatePropertiesKey, state },
}
);
//This StateDataFormat does not use the correct DataProtectionProvider
return _openIdOptions.Get("singpass").CurrentValue.StateDataFormat.Protect(authProperties);
}
However, when the user scanned the QR code and completed the authentication, it redirected back to signin-oidc with the authentication code, I got this error
2021-03-01 11:31:29.918 +08:00 [WRN] .AspNetCore.Correlation. state property not found. 2021-03-01 11:31:29.918 +08:00 [INF] Error from RemoteAuthentication: Correlation failed..
I checked the OpenIdConnectionHandler, the CorrelationId is generated in HandleChallengeAsync() during redirection which does not happen in my case. I don't know how to do the proper configuration without redirection to external authentication login page, is there any advise? Any help would be much appreciated.
Below is my openid configuration:
.AddOpenIdConnect(authenticationScheme: "singpass", "Singpass Authentication", configureOptions =>
{
configureOptions.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
configureOptions.SignOutScheme = IdentityServerConstants.SignoutScheme;
configureOptions.Authority = configuration["Singpass:Authority"];
configureOptions.ClientId = configuration["Singpass:ClientId"];
configureOptions.ResponseType = OpenIdConnectResponseType.Code;
configureOptions.RequireHttpsMetadata = true;
configureOptions.ProtocolValidator = new OpenIdConnectProtocolValidator()
{
RequireState = false,
RequireStateValidation = false,
};
configureOptions.Events.OnAuthorizationCodeReceived = context =>
{
context.TokenEndpointRequest.ClientAssertionType = OidcConstants.ClientAssertionTypes.JwtBearer;
context.TokenEndpointRequest.ClientAssertion = NDIAuthenticationHandler.CreateClientAssertionJwt(
configuration["Singpass:ClientId"],
configuration["Singpass:TokenEndpoint"],
configuration["Key:ThumbPrint"]);
return Task.CompletedTask;
};
})
Hi, I want to force the users to re-login if they are inactive in 30 minutes, I have tried to set the expiry time for Cookies as below but it does not work:
context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
options.Audience = "TestingApplication";
})
.AddCookie("Cookies", options =>
{
options.ExpireTimeSpan = TimeSpan.FromMinutes(30);
options.SlidingExpiration = true;
});
Anyone know how to achieve it? any help would be much appreciated.
Hi, I have requirement that need to force user to logout and re-login if they are inactive for 30 minutes, is there any configuration/setting to achieve it?
Hi, I have set the redis cache to false in appsettings.json. However, I still got this error when deploying the API into UAT server, this issue does not happen in localhost.
appsettings.json:
"Redis": {
"Configuration": "127.0.0.1",
"IsEnabled": "false"
},
Error:
Volo.Abp.AbpInitializationException: An error occurred during ConfigureServices phase of the module SingHealth.DigitalPlatform.DigitalPlatformHttpApiHostModule, SingHealth.DigitalPlatform.HttpApi.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details.
---> StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 1s ago, last-write: 1s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 6s ago, v: 2.0.593.37019
at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 942
Hi, I got this error when trying to download the commercial source code from abp suite:
2021-01-18 13:19:09.480 +08:00 Downloading module: Volo.Identityserver.Ui, version: 3.3.2
2021-01-18 13:19:11.627 +08:00 Error occured while getting the source code for Volo.Identityserver.Ui v3.3.2 - System.Text.Json.JsonException: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker) at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, Type returnType, JsonSerializerOptions options)
at Volo.Abp.Json.SystemTextJson.AbpSystemTextJsonSerializerProvider.Deserialize[T](String jsonString, Boolean camelCase) in D:\github\abp\framework\src\Volo.Abp.Json\Volo\Abp\Json\SystemTextJson\AbpSystemTextJsonSerializerProvider.cs:line 34
at Volo.Abp.Json.AbpHybridJsonSerializer.Deserialize[T](String jsonString, Boolean camelCase) in D:\github\abp\framework\src\Volo.Abp.Json\Volo\Abp\Json\AbpHybridJsonSerializer.cs:line 37
at Volo.Abp.Cli.ProjectBuilding.RemoteServiceExceptionHandler.GetAbpRemoteServiceErrorAsync(HttpResponseMessage responseMessage) in D:\github\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\RemoteServiceExceptionHandler.cs:line 52
at Volo.Abp.Cli.ProjectBuilding.RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(HttpResponseMessage responseMessage) in D:\github\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\RemoteServiceExceptionHandler.cs:line 38
at Volo.Abp.Cli.ProjectBuilding.AbpIoSourceCodeStore.DownloadSourceCodeContentAsync(SourceCodeDownloadInputDto input) in D:\github\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\AbpIoSourceCodeStore.cs:line 221
at Volo.Abp.Cli.ProjectBuilding.AbpIoSourceCodeStore.GetAsync(String name, String type, String version, String templateSource, Boolean includePreReleases) in D:\github\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\AbpIoSourceCodeStore.cs:line 109
at Volo.Abp.Cli.ProjectBuilding.ModuleProjectBuilder.BuildAsync(ProjectBuildArgs args) in D:\github\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\ModuleProjectBuilder.cs:line 48
at Volo.Abp.Cli.Commands.Services.SourceCodeDownloadService.DownloadAsync(String moduleName, String outputFolder, String version, String gitHubAbpLocalRepositoryPath, String gitHubVoloLocalRepositoryPath, AbpCommandLineOptions options) in D:\github\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\Services\SourceCodeDownloadService.cs:line 34
at Volo.Abp.Cli.Commands.GetSourceCommand.ExecuteAsync(CommandLineArgs commandLineArgs) in D:\github\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\GetSourceCommand.cs:line 62
at Volo.Abp.Suite.Controllers.AbpSuiteController.GetSourceAsync(GetSourceInput input)
2021-01-18 13:19:11.643 +08:00 [WRN] ---------- RemoteServiceErrorInfo ----------
{
"code": null,
"message": "\u0027\u003C\u0027 is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.",
"details": null,
"data": {},
"validationErrors": null
}
2021-01-18 13:19:11.643 +08:00 [WRN] '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0. Volo.Abp.UserFriendlyException: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0. at Volo.Abp.Suite.Controllers.AbpSuiteController.GetSourceAsync(GetSourceInput input) at lambda_method1252(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 2021-01-18 13:19:11.643 +08:00 [WRN] Code: 2021-01-18 13:19:11.643 +08:00 [WRN] Details: 2021-01-18 13:19:11.643 +08:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'. 2021-01-18 13:19:11.644 +08:00 [INF] Executed action Volo.Abp.Suite.Controllers.AbpSuiteController.GetSourceAsync (Volo.Abp.Suite) in 4716.7017ms 2021-01-18 13:19:11.645 +08:00 [INF] Executed endpoint 'Volo.Abp.Suite.Controllers.AbpSuiteController.GetSourceAsync (Volo.Abp.Suite)' 2021-01-18 13:19:11.645 +08:00 [INF] Request finished HTTP/1.1 POST http://localhost:3000/api/abpSuite/get-source application/json 111 - 403 - application/json;+charset=utf-8 4717.5272ms