Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Neil Gibbons
    @neilgibbons
    Takes a string file path
    TransferUtilityUploadRequest fileTransferUtilityRequest = new TransferUtilityUploadRequest
                            {
                                BucketName = BucketName,
                                FilePath = item.FileNamePath,
                                StorageClass = S3StorageClass.StandardInfrequentAccess,
                                PartSize = 6291456, // 6 MB.
                                Key = BucketPath + item.Key,
                                ContentType = "text/csv",
                                CannedACL = S3CannedACL.Private
                            };
    Carlos Fernandez
    @carlosrfernandez
    Are all those properties mandatory?
    I wonder if you're setting a part size to be too big. and it's just waiting? Is the file really 6mb?
    Neil Gibbons
    @neilgibbons
    Ooooo - good shout
    It does work though - this issue seems to be intermittant

    Docs say

    Gets or sets the part size of the upload in bytes. The uploaded file will be divided into parts the size specified and uploaded to Amazon S3 individually.

    Carlos Fernandez
    @carlosrfernandez
    Yes, this is because the TransferUtility class can do that. But you don't need to set the part size, because I believe it will do the "split" by itself if it detects a big file coming in
    Neil Gibbons
    @neilgibbons
    I assumed it would fallback gracefully if file not bigger than 6MB
    Carlos Fernandez
    @carlosrfernandez
    My guess is, they give you the option to set part size, if you want to do the partitioning yourself
    I wouldn't bother with it at first. Get the upload working
    And cross that bridge when you get to it :D
    Neil Gibbons
    @neilgibbons
    Ill give it a go
    Carlos Fernandez
    @carlosrfernandez
    :+1:
    Tamás Balogh
    @Lapeno94
    Hello guys,
    We found an issue which is related to sqsclient it can cause http socket exceptions.
    please contact me in private bc from company side I cannot share this in public.
    Regards,
    Tamas
    Henrique Dezani
    @henriquedezani
    Hi. I am using services.AddCognitoIdentity() in my ASP.net Core Application (2.2), but I am working with Web API, and the token result is given back with Cookie. How I get JWT instead of Cookie? The libraries are: Amazon.AspNetCore.Identity.Cognito and Amazon.Extensions.CognitoAuthentication. Thanks
    Ryan Stradling
    @rstradling
    It does not seem like the latest version of the SDK is available in Nuget. I need something >= https://github.com/aws/aws-sdk-net/releases/tag/3.3.580.0 because I need the sts identity. How is this normally updated and published? In nuget https://www.nuget.org/packages/AWSSDK.Core/ I only see version 3.3.103
    Rayhaan Quazi
    @rayhaanq
    Hi everyone, I had a quick question about .NET Core Identity Provider for Amazon Cognito found here: https://github.com/aws/aws-aspnet-cognito-identity-provider
    I added it to my .net core api and it's successfully secured my api. How do I access a user's cognito username though?
    Nitesh
    @nitesh455
    Hi all, Does anyone have any working example of Aws Personalize with .Net Sdk?
    Raymond Sanchez
    @agileraymond
    @rayhaanq you can use this site to decode your jwt token https://jwt.io/. Another option is to use the GetUser api call https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_GetUser.html
    Stuart Morris
    @StuartMorris0
    Hi all, I am trying to use AWS Cognito in an ASP.Net 4.5 application. All the documentation/videos I can find online all relate to .Net Core instead. I am able to get a user logged in, but I am not sure which of the Access/ID/Refresh tokens should be stored in FormsAuthentication. We are simply trying to use Cognito as the IDP behind a controller/path access within a Web App.
    Raymond Sanchez
    @agileraymond
    @StuartMorris0 You can use email or username to store in FormsAuthentication.
    Stuart Morris
    @StuartMorris0
    @agileraymond Right. I understand that but which token should be stored. Also when trying to store the access or Id token. The JWT is too large once encrypted to be stored in a cookie so adding it fails.
    Stuart Morris
    @StuartMorris0
    Is this gitter active?
    stackunderflows
    @stackunderflows
    I'm trying to login via Cognito in a Xamarin Forms app. When I call user.StartsWithSrpAuthAsync, I get an exception of unable to verify secret hash for client. Is there a way to attach the secret hash to the CognitoUser class? I don't see a property for it. Does this nuget not support apps that have a secret?
    stackunderflows
    @stackunderflows
    I figured it out. When you instantiate a new CognitoUser, you have to use a constructor that allows you to pass in the secret. This is the only way to set it because the backing property is private.
    abiehusney25
    @abiehusney25
    anyone have a step by step instructions on how to set it up with Unity?
    7ZHtBazoH6qMp
    @7ZHtBazoH6qMp
    Hey everyone. Does anyone know how I can get the proper JSON that is sent to MediaConvert from the CreateJobRequest model?
    When I serialize the CreateJobRequest model using JsonConvert it doesn't import into the UI.

    Instead of flat properties:
    "TimecodeSource": "Embedded"

    I'm seeing:
    "TimecodeSource": {
    "Value": "Embedded"
    }

    Francisco Ramón Sánchez Favela
    @safv12

    Hi guys!

    I’m trying to write a unit test in c# and I need to mock the response of the methodCreateBatchWrite<T> using Moq

    But I can’t instantiate an object of the BatchWrite<T>object.

    I’m doing this:

    this.dynamoDbMock
        .Setup(m => m.CreateBatchWrite<SomeType>(It.IsAny<DynamoDBOperationConfig>()))
        .Returns(Mock.Of<BatchWrite<SomeType>>());

    Any idea of how can I mock this object.

    Thank you!

    iShorty123
    @iShorty123
    Hello, can anyone here help me with building via Unity and IL2CPP? I have a link.xml file but I'm still receiving errors when I try to call a Lambda function
    iShorty123
    @iShorty123
    If you can help, please reply to the post I made here: https://forums.awsgametech.com/t/unity-realtime-gamelift-client-not-working-with-il2cpp-build/8483 thank you
    Raymond Sanchez
    @agileraymond
    @safv12 You need to return an actual object in the .Returns section. For example,
    var myObject = new Obj();
    this.dynamoDbMock
    .Setup(m => m.CreateBatchWrite<SomeType>(It.IsAny<DynamoDBOperationConfig>()))
    .Returns(myObject);
    alexgsingh
    @alexgsingh

    Hi all, I am trying to use Amazon.Extensions.CognitoAuthentication library. I can authenticate a user with the user in Cognito Userpool but then when trying to upload to s3 using an Identitypool, I get the following error. Please advise? FYI I am using .net c# in Xamarin

    at Amazon.S3.Util.BucketRegionDetector.GetUsEast1ClientFromCredentials (Amazon.Runtime.ImmutableCredentials credentials) [0x00000] in <f978334983bd4d62a4fa9583dc601968>:0
    at Amazon.S3.Util.BucketRegionDetector.GetHeadBucketPreSignedUrl (System.String bucketName, Amazon.Runtime.ImmutableCredentials credentials) [0x00000] in <f978334983bd4d62a4fa9583dc601968>:0
    at Amazon.S3.Util.BucketRegionDetector.GetBucketRegionNoPipelineAsync (System.String bucketName, Amazon.Runtime.ImmutableCredentials credentials) [0x0000a] in <f978334983bd4d62a4fa9583dc601968>:0
    at Amazon.S3.Util.BucketRegionDetector.DetectMismatchWithHeadBucketFallbackAsync (Amazon.S3.Util.AmazonS3Uri requestedBucketUri, Amazon.Runtime.AmazonServiceException serviceException, Amazon.Runtime.ImmutableCredentials credentials) [0x00092] in <f978334983bd4d62a4fa9583dc601968>:0
    at Amazon.S3.Internal.AmazonS3RetryPolicy.SharedRetryForExceptionAsync (Amazon.Runtime.IExecutionContext executionContext, System.Exception exception, System.Func3[T1,T2,TResult] retryForExceptionSync, System.Func3[T1,T2,TResult] baseRetryForException) [0x000e2] in <f978334983bd4d62a4fa9583dc601968>:0
    at Amazon.S3.Internal.AmazonS3RetryPolicy.RetryForExceptionAsync (Amazon.Runtime.IExecutionContext executionContext, System.Exception exception) [0x00091] in <f978334983bd4d62a4fa9583dc601968>:0
    at Amazon.Runtime.RetryPolicy.RetryAsync (Amazon.Runtime.IExecutionContext executionContext, System.Exception exception) [0x000ed] in <3be753f269f04a3baa3e67389f87b6c2>:0
    at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T] (Amazon.Runtime.IExecutionContext executionContext) [0x001fd] in <3be753f269f04a3baa3e67389f87b6c2>:0
    at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T] (Amazon.Runtime.IExecutionContext executionContext) [0x00080] in <3be753f269f04a3baa3e67389f87b6c2>:0
    at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T] (Amazon.Runtime.IExecutionContext executionContext) [0x00080] in <3be753f269f04a3baa3e67389f87b6c2>:0
    at Amazon.S3.Internal.AmazonS3ExceptionHandler.InvokeAsync[T] (Amazon.Runtime.IExecutionContext executionContext) [0x00099] in <f978334983bd4d62a4fa9583dc601968>:0
    at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T] (Amazon.Runtime.IExecutionContext executionContext) [0x00099] in <3be753f269f04a3baa3e67389f87b6c2>:0
    at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T] (Amazon.Runtime.IExecutionContext executionContext) [0x000ab] in <3be753f269f04a3baa3e67389f87b6c2>:0
    at Amazon.S3.Transfer.Internal.SimpleUploadCommand.ExecuteAsync (System.Threading.CancellationToken cancellationToken) [0x00120] in <f978334983bd4d62a4fa9583dc601968>:0
    at MobileAnalyser.Services.S3DataStore.AddItemAsync (System.String filePath, System.String key, System.Threading.CancellationToken token)

    Jonas Steinberg
    @jonassteinberg1
    is there a way to specify a proxy bypass? I have some domains that when requested should not be proxied to, e.g. s3.amazonaws.com (because of course this has a vpc endpoint)
    Fagro Vizcaino
    @fagro-vizcaino
    Hi Guys

    I'm getting this error after I spend a few minutes on the Amazon Cognito Login Page of my app and then try to login:

    System.Exception: An error was encountered while handling the remote login. ---> System.Exception: Correlation failed.
    --- End of inner exception stack trace ---
    at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.HandleRequestAsync()
    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
    at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
    at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
    at Cbord.LandingPage.Web.Startup.<>c.<<Configure>b__6_0>d.MoveNext() in /src/LandingPage/LandingPage.Web/Startup.cs:line 306
    --- End of stack trace from previous location where exception was thrown ---
    at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

    Can you please point me in the right direction ?

    Fagro Vizcaino
    @fagro-vizcaino
    This is my Startup.cs:
     services.AddScoped<IViewRenderService, ViewRenderService>();
    
                services.AddMvc()
                    .AddViewLocalization()
                        .AddDataAnnotationsLocalization()
                    .AddJsonOptions(options =>
                    {
                        options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
                        options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
                    });
    
                services.AddDefaultAWSOptions(Configuration.GetAWSOptions());
                services.AddAuthorization(options =>
                {
                    //Temporary Authorization FIX - added roles policy (to test roles), while AwsCognito - policy not implemented
                    options.AddPolicy("RequireRoles",
                        policy => policy.RequireRole("SysAdmin", "OrgAdmin", "PhiUser", "User"));
                });
    
                services.AddScoped<ILandingPageUserService, LandingPageUserService>();
                services.AddAuthentication(options =>
                {
                    options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                    options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                    options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
                })
                    .AddCookie(options =>
                    {
                        //options.Cookie.SecurePolicy = mEnvironment.IsDevelopment()
                        //    ? CookieSecurePolicy.None
                        //    : CookieSecurePolicy.Always;
                        options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
                        options.Cookie.SameSite = SameSiteMode.None;
                        options.Cookie.Expiration = TimeSpan.FromMinutes(4.5);
                    })
                    .AddOpenIdConnect(options =>
                    {
                        options.ResponseType = Configuration["Authentication:Cognito:ResponseType"];
                        options.MetadataAddress = Configuration["Authentication:Cognito:MetadataAddress"];
                        options.ClientId = Configuration["Authentication:Cognito:ClientId"];
                        //options.CallbackPath = new PathString(Configuration["Authentication:Cognito:CallbackUrl"]);
                        options.SaveTokens = bool.Parse(Configuration["Authentication:Cognito:SaveToken"]);
                        options.UseTokenLifetime = true;
                        options.Events = new OpenIdConnectEvents
                        {
                            OnTokenValidated = async context =>
                            {
                                var authService = context.HttpContext.RequestServices
                                    .GetRequiredService<IUserAuthenticationService>();
                                await authService.OnTokenValidated(context,
                                    Configuration["Authentication:Cognito:SignedOutRedirectUri"]);
                            },
                            OnRedirectToIdentityProvider = async context =>
                            {
                                var authService = context.HttpContext.RequestServices
                                    .GetRequiredService<IUserAuthenticationService>();
                                await authService.OnRedirectToIdentityProvider(context,
                                    Configuration["Authentication:Cognito:ClientId"]);
                            },
                            OnRedirectToIdentityProviderForSignOut = context =>
                            {
                                var logoutUri =
                                    HttpUtility.UrlEncode(Configuration["Authentication:Cognito:SignedOutRedirectUri"]);
                                var issuerAddress =
                                    $"{Configuration["Authentication:Cognito:LogoutEndpoint"]}/logout?logout_uri={logoutUri}";
                                var authService = context.HttpContext.RequestServices
                                    .GetRequiredService<IUserAuthenticationService>();
    Omar Himada
    @omarhimada
    which one is line 306
    Fagro Vizcaino
    @fagro-vizcaino
    @omarhimada :
      public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, ConfigSettings config)
            {
    
                var localizationOptions = new RequestLocalizationOptions
                {
                    SupportedCultures = new List<CultureInfo> { new CultureInfo("en-US") },
                    SupportedUICultures = new List<CultureInfo> { new CultureInfo("en-US") },
                    DefaultRequestCulture = new RequestCulture("en-US")
                };
    
                app.UseRequestLocalization(localizationOptions);
                if (env.IsDevelopment() && config.EnableDevelopmentExceptions)
                {
                    app.UseDeveloperExceptionPage();
                }
                else
                {
                    app.UseExceptionHandler("/Error");
                }
    
                app.Use(async (context, next) =>
                {
                    if (context.Request.Path.Value.Contains("invalid"))
                        throw new Exception("ERROR"); <---------------------------------------------------Line 306
    
                    context.Request.Scheme = "https";
                    //if (!env.IsDevelopment())
                    //{
                    //    context.Request.Scheme = "https";
                    //}
                    await next();
                });
                app.UseCookiePolicy();
                app.UseAuthentication();
                app.UseMvc(routes =>
                {
                    routes.MapRoute(
                        name: "federated",
                        template: "SignIn/{lookupName}",
                        defaults: new { controller = "Account", action = "Auth" });
                    routes.MapRoute("Default", "{controller=Home}/{action=Index}");
                });
    
                app.UseFileServer();
            }
    Omar Himada
    @omarhimada
    you have app.UseAuthentication()
    do you also need app.UseAuthorization()?
    Fagro Vizcaino
    @fagro-vizcaino
    Not so sure. Why ?
    Omar Himada
    @omarhimada
    try useauthorization before useauth
    see if exception persists shrug
    its just that your stacktrace talks about session and i dont normally see use authentication without authorization. just a hunch really
    Fagro Vizcaino
    @fagro-vizcaino
    umm you mean:
     app.UseCookiePolicy();
      app.UseAuthorization();  <-----
      app.UseAuthentication();
    Omar Himada
    @omarhimada
    ya give it a shot