app.Use(async ...
but if that doesnt work i think the problem is in there for sure
app.Use(async...
To initialize the device for use
. I'm having a hard time determining which cert I'm supposed to be passing and if I need to generate a csr.
options.Events = new OpenIdConnectEvents
{
OnRemoteFailure = context =>
{
if (context.Failure.Message.Contains("Correlation failed"))
context.Response.Redirect("/");
else
throw new Exception("ERROR");
context.HandleResponse();
return Task.CompletedTask;
},
}
I'm facing another weird stuff, let me see if you guys point me to the right direction
This is what I'm trying to accomplish:
If the user login successfully and completed an operation and then instead of signing out just closes the browser tab. Now let's say that after a period of 10 minutes, the user decides to log in again I want to redirect the user to the login page. Instead of automatically login in and go directly to the homepage (that's the behavior that is currently happening).
Hello there, I hope someone can help me, I have been searching everywhere without finding a solution that works.
I am using the AWS sdk in dotnet 3.1 worker service to process and upload files to MinIO. Smaller uploads work correctly using the low-level API, but as soon as uploads go over 25mb or so, the uploads get stuck at 100% on the CompleteMultipartUploadAsync. It eventually times out and then fails to complete the upload.
Can someone push me in the right direction?
First of all, thank you for the great work.
I am creating an authentication process using Cognito's StartWithCustomAuthAsync, but I am having an issue with the userAttributes email being undefined in the lambda function that is triggered by this execution. Do you have a solution?
client side code
private static IDictionary<string, string> CreateClientMetadata(string username)
{
Dictionary<string, string> meta = new Dictionary<string, string>
{
{ "USERNAME", username },
{ "PASSWORD", Random.RandomString(30) },
{ "name", username }
};
return meta;
}
private static IDictionary<string, string> CreateAuthParameters(string username)
{
var authParams = new Dictionary<string, string>
{
{ "USERNAME", username },
{ "PASSWORD", Random.RandomString(30) },
{ "email", "test@gmail.com" }
};
return authParams;
}
private CognitoUser CreateCognitoUser(string username)
{
var provider =
new AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), RegionEndpoint.APNortheast1);
var userPool = new CognitoUserPool(Settings.POOL_ID, Settings.CLIENT_ID, provider);
return new CognitoUser(username, Settings.CLIENT_ID, userPool, provider);
}
public async Task<string> Signup(string username)
{
var user = this.CreateCognitoUser(username);
var authRequest = new InitiateCustomAuthRequest()
{
ClientMetadata = this.CreateClientMetadata(username),
AuthParameters = this.CreateAuthParameters(username)
};
var authResponse = await user.StartWithCustomAuthAsync(authRequest).ConfigureAwait(false);
}
lambda code
import { CognitoUserPoolTriggerHandler } from 'aws-lambda';
export const handler: CognitoUserPoolTriggerHandler = async event => {
if (!event.request.session || !event.request.session.length) {
event.request.userAttributes.email
}
}
Amazon.Runtime.AmazonServiceException: Unable to get IAM security credentials from EC2 Instance Metadata Service.
at Amazon.Runtime.DefaultInstanceProfileAWSCredentials.FetchCredentials()
at Amazon.Runtime.DefaultInstanceProfileAWSCredentials.GetCredentials()
at Amazon.Runtime.DefaultInstanceProfileAWSCredentials.GetCredentialsAsync()
at Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync[T](IExecutionContext executionContext)
at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)
at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)
at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext)
at Amazon.Extensions.CognitoAuthentication.CognitoUserPool.FindByIdAsync(String userID)
at Amazon.AspNetCore.Identity.Cognito.CognitoUserStore`1.FindByIdAsync(String userId, CancellationToken cancellationToken)
at Amazon.AspNetCore.Identity.Cognito.CognitoUserManager`1.FindByIdAsync(String userId)
at Amazon.AspNetCore.Identity.Cognito.CognitoSignInManager`1.PasswordSignInAsync(String userId, String password, Boolean isPersistent, Boolean lockoutOnFailure)