You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 15, 2018. It is now read-only.
I added to custom claims to the CreateProperties metadata of the MembershipRebootIdentityManagerService by the use of a custom metadataFunc.
I wanted to set Name, Phone and other custom claims, mandatory on the create and update...
However an error occurred when creating the user, because of the function CreateUserAsync on the MembershipRebootIdentityManagerService class.
The following code block (lines 288 to 291):
foreach (var prop in otherProperties)
{
SetUserProperty(createProps, acct, prop.Type, prop.Value);
}
The SetUserProperty fails when the property is a claim and not a field of the user account.
It implies that the account is already created, when before adding it invokes : UserAccountService.RemoveClaim.
it does the following
var account = base.GetByID(accountID);
if (account == null) throw new ArgumentException("Invalid AccountID", "accountID");
Which threw the error since the this.userAccountService.CreateAccount happens after.
The change i did, to do the otherproperties after the account is created on the repository.
It is not perfect, since it should on do so, for the claims, and not for example, Phone.. However, since they are not mandatory, this was a quick fix.
The text was updated successfully, but these errors were encountered:
Hmm... this is a tricky problem. The idea with Create properties or required properties was that these were needed to be assigned to the object before the create call in the DB (such as a field on the entity class). In you scenario, the logical property's set needs to use the user manager's API, which assumes the user account already exists in the DB.
If you have any suggestions, I'd love to hear.
The only thing I can think of right now is to register a different create property that sets the claim into the entity directly (of course that circumvents the user account service, but it might be ok). The other thought would be to override CreateUserAsync, filter the properties, call the base, and then after the base's create is called then you call SetUserProperty for the filtered claims.
I am looking for gui configure for same as in memory come from database.. please help.. is this help to me how to create the client, scopeclaim and etc on GUI.. ANY OPEN source for this..
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
I added to custom claims to the CreateProperties metadata of the MembershipRebootIdentityManagerService by the use of a custom metadataFunc.
I wanted to set Name, Phone and other custom claims, mandatory on the create and update...
However an error occurred when creating the user, because of the function CreateUserAsync on the MembershipRebootIdentityManagerService class.
The following code block (lines 288 to 291):
foreach (var prop in otherProperties)
{
SetUserProperty(createProps, acct, prop.Type, prop.Value);
}
The SetUserProperty fails when the property is a claim and not a field of the user account.
It implies that the account is already created, when before adding it invokes : UserAccountService.RemoveClaim.
it does the following
var account = base.GetByID(accountID);
if (account == null) throw new ArgumentException("Invalid AccountID", "accountID");
Which threw the error since the this.userAccountService.CreateAccount happens after.
The change i did, to do the otherproperties after the account is created on the repository.
It is not perfect, since it should on do so, for the claims, and not for example, Phone.. However, since they are not mandatory, this was a quick fix.
The text was updated successfully, but these errors were encountered: