Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Fagro Vizcaino
    @fagro-vizcaino

    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).

    Omar Himada
    @omarhimada
    you want to configure session length
    Fagro Vizcaino
    @fagro-vizcaino
    @omarhimada I did, but it's not working. It clears all cookies after 20 min (with the browser close) but I don't any idea where that configuration is coming from.
    bakhtiyar-ospanov
    @bakhtiyar-ospanov
    Hi guys! Are there any updates on download progress callback for AWS Unity SDK (AmazonS3Client.GetObjectAsync)?
    Stiaan Jacobs
    @stiaanj

    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?

    Raymond Sanchez
    @agileraymond
    @stiaanj When you upload a 25mb or bigger, how many parts are you using to upload it?
    Stiaan Jacobs
    @stiaanj
    Its set to use 5mb chunks, 5 parts
    Brad Wight
    @bwarfson
    Hello there, is anyone using an AWS Serverless Application (.Net Core 3.1) with RDS for SQL Server? We are using ADO.net and the repository pattern. If so, what are some best practices for connection pooling? I've been searching and searching but not finding specific examples for AWS Serverless with RDS SQL Server. I've read up on RDS proxy but i guess that doesn't work with SQL Server.
    Omar Himada
    @omarhimada
    have you tried Dapper?
    if ever i cannot use entity framework dapper is right there to save the day
    Jeff Hotchkiss
    @hotchkj
    Hi, is there a way to have S3 uploads resume using the NET Transfer Utility? For example, there's an interruption uploading 20 parts to an object or signed URL, 10 parts are already present in S3, can we resume such that only the remaining 10 parts need to be uploaded? If not, is this something we could consider raising an issue & potential PR for?
    Oscar Andersson
    @NiceGuyAndersson
    Since there's no LoadTableAsync() in the .NetStandard2.0 binaries of DynamoDB, is it impossible to use the Document model in Unity with those binaries?
    Oscar Andersson
    @NiceGuyAndersson
    Actually, I suppose I could convert all my Documents to AttributeMaps and use the non-document functions for network calls
    MikeEllisARB
    @MikeEllisARB
    Hi, I'm having a hard time finding a working example for my scenario, so if anyone can point me in the right direction, I would appreciate it. I'm coming from IdentityServer4, so that's what I'm familiar with. Can I connect an ASP.NET Core app running on my own servers to Cognito for Authentication (and Authorization via Groups)? If so, when my app hits a secured method with [Authorize], can I have the user redirected to Cognito and its login prompt at that point, or do I have to present the user with my own login page and handle the authentication programmatically? Thanks!
    Philip Pittle
    @ppittle
    @ellismichaelarb - I haven't tried it myself, but have you tried the ASP.NET Core Identity Provider for Amazon Cognito? Think this should have what you need: https://aws.amazon.com/blogs/developer/introducing-the-asp-net-core-identity-provider-preview-for-amazon-cognito/
    MikeEllisARB
    @MikeEllisARB
    @ppittle Thanks, I am using that library, but that page leaves some important details out (or I'm just thick). This article has helped me and may have the answers. https://chandradev819.wordpress.com/2020/01/18/aws-cognito-service-in-asp-net-core-3-1-application/
    Sho Nagai
    @shoNagai

    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
        }
    }
    Phillip Haydon
    @phillip-haydon
    This message was deleted
    Omar Himada
    @omarhimada
    hello AWS folks. i've been integrating with Cognito quite a bit and oftentimes in a different medium
    but i've run into an exception lately that i've never seen before
    i've deployed a .NET core application to a windows server (not EC2) and its giving me this error whenever it makes a request
    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)
    does the aws-sdk think it is deployed in EC2? i believe it may be attempting to use 169.254.169.254
    i've tried a few things based on what i could find as issues on github/google/stackoverflow
    Omar Himada
    @omarhimada
    i can see that the credentials are being retrieved
    info: AWSSDK[0]
    
          Found AWS options in IConfiguration
    
    info: AWSSDK[0]
    
          Found credentials using the AWS SDK's default credential search
    Omar Himada
    @omarhimada
    any insight regarding my issue would be greatly appreciated
    still scratching my head on it
    Omar Himada
    @omarhimada
    it is apparent that AWSSDK works when deployed to AWS, and Azure, but when deployed to an on-premises Windows Server 2019 it craps the bed
    it is indeed making calls to 169.254.169.254, i confirmed this with a packet trace
    EC2Launch apparently configures the routing, but i don't want to turn my own Windows Server on-premises box into an EC2 instance just to get cognito authentication to work
    Jesse Ehrenzweig
    @jehrenzweig

    Question for you fine folks: I'm writing a .NET Core 3.1 console app (C#) with a custom DynamoDB property converter that implements Amazon.DynamoDBv2.DataModel.IPropertyConverter. It works as expected when I tag my POCO class using Amazon.DynamoDBv2.DataModel.DynamoDBPropertyAttribute:

    namespace MyStuff
    {
        using System;
        using System.Collections.Generic;
        using Amazon.DynamoDBv2.DataModel;
    
        public class Dashboard
        {
            [DynamoDBProperty(typeof(WidgetConverter))]
            public List<Widget> Widgets { get; set; }
        }
    }

    Is it possible to wire up the custom DynamoDB property converter without tagging up my POCO class property using the DynamoDBProperty attribute? I've seen some code snippets that add mappings via the context, but I've been unable to get any of them to work.

    amrdarawsheh
    @amrdarawsheh
    Anyone here uses aws transcribe with .NET core?
    Mark Davies
    @joro550

    Hey, hoping you can help - I've cloned the repo from master and am getting the following exception when running the tests:

    The value of the property 'type' cannot be parsed. The error is: The type 'AWSSDK_DotNet.IntegrationTests.Tests.DynamoDB.DynamoDBTests+Employee, AWSSDK.IntegrationTestUtilities.Net35' cannot be resolved.

    Is there a Getting started guide I can refer to

    1 reply
    danieltallentire
    @danieltallentire
    Hi - I've got a weird issue with the Lex API calling from dot net, wondering if anyone has ever troubleshooted something similar;
    I'm calling AmazonLexClient.PostText. On my debug environment and on one server this works fine. On another server, every call to PostText is doubled. It makes two almost simultaneous requests. I'm not calling PostText twice because I've stuck logging all around it. I've confirmed that they are two full requests by checking with Fiddler, and I can see both going through. Lex throws a wobbly because it has two requests at the same time, and sends me a 409 conflict exception, which is the response that comes back to my code, even though one of the requests is actually succesful. Any ideas?
    1 reply
    Chase Q. Aucoin
    @chaseaucoin

    Hey room, found a pretty big bug in the AWS SDK. The model generator is not correctly handling nullable types across all products. This could be creating transient errors or silent failures on your calls into the SDK across the entire platform. Just trying to get more visibility on it.

    aws/aws-sdk-net#1721

    DoraiswamyG
    @DoraiswamyG
    Hi - need to unzip an archive in s3. The file size will be within lambda limit of 500MB. Can some one point how to unzip the file from source bucket to another destination bucket in s3.
    michaelwatkins
    @michaelwatkins

    Hello - I'm using the CognitoIdentity SDK, I do not see where I can set the expiration of AWS Credentials.

    I am using a two step process:
    GetOpenIdTokenForDeveloperIdentity(),
    GetCredentialsForIdentity()

    I can only set the expiration on the OpenIdToken (1st method), but do not see where to set the expiration for the credentials method (2nd method)

    Thank you in advanced for suggestions.

    HeckDotExe
    @HeckDotExe
    Hi there! I've been having some difficulty getting my AWS program to work. I'm using S3 and getting data from there, but every time I run it, it brings up issues of a Null Reference Exception in places like this: Amazon.Runtime.Internal.UnityMainThreadDispatcher+<InvokeRequest>d__7.MoveNext ()
    Any advice?
    Thanks!
    Jason Elie Bou Kheir
    @jasonboukheir

    Adding onto the weird issues with S3...

    I'm trying to get it working on android for Unity 2019.4 -- running into a NullReference in constructing InternalLog4NetLogger. I use log4net for another dependency, wondering if anyone has any tips. Here's the stack trace:
    2020/11/19 08:59:48.166 8135 8160 Error Unity NullReferenceException: Object reference not set to an instance of an object.
    2020/11/19 08:59:48.166 8135 8160 Error Unity at Amazon.Runtime.Internal.Util.InternalLog4netLogger..ctor (System.Type declaringType) [0x00000] in <00000000000000000000000000000000>:0
    2020/11/19 08:59:48.166 8135 8160 Error Unity at Amazon.Runtime.Internal.Util.Logger..ctor (System.Type type) [0x00000] in <00000000000000000000000000000000>:0
    2020/11/19 08:59:48.166 8135 8160 Error Unity at Amazon.Runtime.Internal.Util.Logger.GetLogger (System.Type type) [0x00000] in <00000000000000000000000000000000>:0
    2020/11/19 08:59:48.166 8135 8160 Error Unity at Amazon.Util.Internal.AmazonHookedPlatformInfo..cctor () [0x00000] in <00000000000000000000000000000000>:0
    2020/11/19 08:59:48.166 8135 8160 Error Unity at Amazon.UnityInitializer.Awake () [0x00000] in <00000000000000000000000000000000>:0
    2020/11/19 08:59:48.166 8135 8160 Error Unity at UnityEngine.GameObject.AddComponent[T] () [0x00000] in <00000000000000000000000000000000>:0
    2020/11/19 08:59:48.166 8135 8160 Error Unity at Amazon.UnityInitializer.AttachToGameObject (UnityEngine.GameObject gameObject) [0x00000] in <00000000000000000000000000000000>:0

    1 reply
    Philip Pittle
    @ppittle
    Happy 2021 everyone
    ajmcateer
    @ajmcateer
    This place seems kind of dead is there a better place to go for questions?
    I was wondering what role "aws-lambda-tools-defaults.json" plays in the Serverless Core template? I have region set but its not getting it instead it wants me to put it in the appsettings.
    Do I need it in both?
    Philip Pittle
    @ppittle
    I'm pretty sure the aws-lambda-tools-defaults.json is mostly used by the AWS Toolkit for Visual Studio tooling; it shouldn't be consumed by your application. defaults.json remembers the last place you deployed during development. appsettings.json is meant to be consumed by your code. So if you have a lambda function that writes to a SQS queue, your code needs to know which region to look for that queue. For testing, you may configure your local tooling to deploy to US-WEST-2, that would be saved to defaults.json, but your application needs to connect to a queue in US-EAST-1, so the appsettings.json would have us-east-1.
    __pp__
    @kpradp
    Hi need help in accessing encrypted bucket elements c# sdk
    Srini Vasudevan
    @srini85

    Hi Guys, Im having some issues with setting up a dotnet server that can verify jwt generated from aws cognito.

    I am using this sample as my guide. https://aws.amazon.com/blogs/developer/introducing-the-asp-net-core-identity-provider-preview-for-amazon-cognito/

    this is what I have done so far

    1. Create a new cognito User Pool
    2. Created two App Clients on the UserPool (Both clients are using Client Credentials OAuth Flow as I am after machine to machine auth)
    3. Used the App Client on the server that will be used to verify the JWT
    4. Using Postman, and hit the /oauth2/token endpoint using my app client. I Am using grant_type as client_credentials and passing in basic auth. (client id and client secret). I have successfully received an auth token
    5. Use that token in my auth header to my server. It is passed in as bearer <token>
    6. I get back a 401 Unauthorized on my protected resource.

    I have tried to use both the app clients client id and secret to generate a JWT and both of them say unauthorized. Also I have not created any custom authorization policies. I am only after a authenticated resource at this point before I look at authorization

    Srini Vasudevan
    @srini85
    Ive got it working. I found another link on setting up the authentication using jwt bearer token.
    I didnt have any luck using thr cognito extensions package
    Janahan Balasingham
    @jb-infinitai
    I'm looking for some help on authentication for older .NET core framework. An old project is running in ASPNETCore.MVC version 1.1.3 using Net Framework 4.5.2. The AWSSDK.Extensions.NETCore.Setup is only compatible with .NET Standard 1.3 and above. I can't find any instructions on how to authenticate in previous versions.