Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWP registration workflow #821

Open
BrunoFelipe-dev opened this issue Nov 22, 2024 · 2 comments
Open

PWP registration workflow #821

BrunoFelipe-dev opened this issue Nov 22, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@BrunoFelipe-dev
Copy link

In the PWD registration flow, a username and password are requested.
It is possible to register a user by adding a valid email address to the username field. However, when logging in, the following error occurs:

ArgumentException: Invalid cookie name: [email protected] (Parameter 'value') Microsoft.Net.Http.Headers.CookieHeaderValue.CheckNameFormat(StringSegment name, string parameterName)

Register:
Captura de tela 2024-11-22 113121

User created:
Captura de tela 2024-11-22 113138

Login:
Captura de tela 2024-11-22 114131

Error on submit:
Captura de tela 2024-11-22 113257

Is it possible to implement a registration flow where the user is able to register with "email (in the username field) and password" to log in?

What should I do to make possible to do it this way, since it is how applications with identity server usually do it.
In my case, I would like to force the username to always be an email address in the registration step and validate the email using code in a second step in my application.

@simpleidserver simpleidserver self-assigned this Nov 22, 2024
@simpleidserver simpleidserver added the bug Something isn't working label Nov 22, 2024
@simpleidserver simpleidserver moved this to In Progress in Release 5.0.3 Nov 22, 2024
@simpleidserver
Copy link
Owner

To always use the email as the login, the property IsEmailUsedDuringAuthentication must be set to true.
Edit the Program.cs file and modify the options as follows:

idServerBuilder = services.AddSIDIdentityServer(callback: cb =>
        {
            cb.IsEmailUsedDuringAuthentication = true;
            if (!string.IsNullOrWhiteSpace(identityServerConfiguration.SessionCookieNamePrefix))
                cb.SessionCookieName = identityServerConfiguration.SessionCookieNamePrefix;
            cb.Authority = identityServerConfiguration.Authority;
            cb.ScimClientOptions = conf;
        }, cookie: c =>
        {
            if (!string.IsNullOrWhiteSpace(identityServerConfiguration.AuthCookieNamePrefix))
                c.Cookie.Name = identityServerConfiguration.AuthCookieNamePrefix;
        }, dataProtectionBuilderCallback: ConfigureDataProtection)

Configuring the Registration Workflow

Follow these steps to configure the registration workflow:

  1. Open the administration website and navigate to the Manual Identity Provisioning section.
  2. Click the add registration workflow button and fill out the form with the following values:
  • Name : workflow
  • Auth methods : pwd, email
  1. Click the add button to confirm the creation.

The registration workflow is now ready for use and can be accessed via the following URL:: https://localhost:5001/master/registration?workflowName=workflow

Checking Email Client Configuration

Before launching the registration workflow, ensure the email client is properly configured:

  1. Open the administration website and navigate to the Authentication window.
  2. Click on the Email element and verify that the configuration is correct.

Known issue

There is currently a minor issue with cookie creation. This issue will be resolved in the Release503 branch.

@BrunoFelipe-dev BrunoFelipe-dev changed the title PWP refistration workflow PWP registration workflow Nov 22, 2024
thabart added a commit that referenced this issue Nov 23, 2024
@simpleidserver
Copy link
Owner

The issue has been fixed in the Release503 branch.
Now, when the login is in an email format, authentication will work. :)

@simpleidserver simpleidserver closed this as completed by moving to Done in Release 5.0.3 Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants