Git Product home page Git Product logo

aspnetcore.identity.dynamodb's People

Contributors

cmsd2 avatar frmokoena avatar mattwhetton avatar miltador avatar sorenz avatar tugberkugurlu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aspnetcore.identity.dynamodb's Issues

RoleManager.CreateAsync calls unsupported SetNormalizedRoleNameAsync

https://github.com/aspnet/Identity/blob/dev/src/Microsoft.AspNetCore.Identity/RoleManager.cs#L168

we don't allow the normalized role name to change for good reason,
but the role manager depends on this function succeeding.

also if the user has chosen a different ILookupNormalizer than the normal UpperInvariantNormalizer, the default initialisation of NormalizedRoleName in DynamoIdentityRole will not match the expected normalized role name.

Identity Options does not contain a definition for "Cookies"

Hello,

This is a great project. However, it seems that IdentityOptions have move on and no longer have the Cookies extension.

Any thoughts on how to solve this?


var id = new ClaimsIdentity(Options.Cookies.ApplicationCookieAuthenticationScheme,
                    Options.ClaimsIdentity.UserNameClaimType,
                    Options.ClaimsIdentity.RoleClaimType);

Regards,

Daniel

querying users by email in login

In the sample project's account manager I'm trying this so I can lookup email instead of name:

var user = await _userManager.FindByEmailAsync(model.Email);
await _signInManager.PasswordSignInAsync(user, ...)

which does a _context.LoadAsync(normalizedEmail)

I can't get that to work with the GSI -- it just returns null. Is it hitting the users table instead of the index?

so I tried changing it to use the Document model Query method:

Table table = Table.LoadTable(_client, Constants.DefaultTableName);
QueryOperationConfig config = new QueryOperationConfig() 
{
    IndexName = "Email.NormalizedValue-DeletedOn-index",
    KeyExpression = new Expression()
    {
        ExpressionStatement = "Email.NormalizedValue = :e",
        ExpressionAttributeValues = new Dictionary<string, DynamoDBEntry> {
            {":e", new Primitive(normalizedEmail)}
        }
    }
};
Search search = table.Query(config);
var results = await search.GetNextSetAsync(cancellationToken);
var userDocument = results.FirstOrDefault();
user = _context.FromDocument<TUser>(userDocument);

That rejects the KeyExpression because it is on a nested attribute of the Email Map attribute.

Any tips?

(testing this with the dynamodb docker container fwiw)

Table Names

DynamoDB tables for users and roles are created using the names in appsettings.json. However, the dll is using set values (constants) for the table names: [DynamoDBTable("users")], [DynamoDBTable("roles")].

Table initialization fails if there are more than 100 tables.

UserStore, RoleStore, and RoleUserStore initialization can fail if there are more than 100 dynamoDb tables in an AWS account. The ListTablesAsync() method that is ran in the EnsureInitializedAsync() methods returns paged results (100 per page), but this library only takes the first page. Since that method is used to determine if a table already exists, it will sometimes think the table does not exist when it actually does. The table is then attempted to be created but results in an error as it's already there.

This can be fixed by simply running through all the pages of the ListTablesAsync() result before checking to see if the table exists or not.

Update for Identity 2 ?

Are there any plans to update this for Identity 2 ? I cant get it to compile in a .net 2 app using Identity 2. Mostly errors like : The type or namespace name 'Claim' could not be found.

User and Role claims don't support multiple claims with the same type or value

both users and roles have the same pattern for storing claims,
and they both require that the claim types and the claim values are a set of unique items
(dynamodb does not allow inserting duplicates into a string set).

I think this is too restrictive and it denies legitimate uses of claims:
e.g. http://benfoster.io/blog/asp-net-identity-role-claims

https://docs.microsoft.com/en-us/aspnet/core/security/authorization/claims
f.t.a:
"An identity can contain multiple claims with multiple values and can contain multiple claims of the same type."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.