# Assigning different roles to a user based on registration path

**URL:** <https://community.auth0.com/t/assigning-different-roles-to-a-user-based-on-registration-path/188306>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [June 23, 2025, 3:49pm UTC](https://community.auth0.com/t/assigning-different-roles-to-a-user-based-on-registration-path/188306 "2025-06-23T15:49:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![baynezy](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/baynezy/32/49885_2.png) [@baynezy](https://community.auth0.com/u/baynezy)\
**Post date:** [June 23, 2025, 3:49pm UTC](https://community.auth0.com/t/assigning-different-roles-to-a-user-based-on-registration-path/188306/1 "2025-06-23T15:49:32Z")

</div>

I have 2 user types free read-only users and paid read and write access users. To model this in Auth0 I have 2 roles created and all the relevant permissions defined.

I want users to be able to register and depending on which registration flow they embark on I want them to be assigned to the corresponding Auth0 user role.

How can this be done?

1. Can I indicate in the /authorize endpoint which role they are registering for?
2. I know I can use the management API from my application, but that means their existing auth token will be outdated.

---

<div class="post-metadata">

**Author:** ![vlad.murarasu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vlad.murarasu/32/72793_2.png) [@vlad.murarasu](https://community.auth0.com/u/vlad.murarasu)\
**Post date:** [June 23, 2025, 7:37pm UTC](https://community.auth0.com/t/assigning-different-roles-to-a-user-based-on-registration-path/188306/3 "2025-06-23T19:37:38Z")

</div>

Hi @baynezy,

To answer your questions:

1. To add custom parameters to your sign-up flow, you can use the [AuthorizationParams](https://auth0.github.io/auth0-spa-js/interfaces/AuthorizationParams.html) interface in the auth0-spa-js library.
2. You’re right about the auth token expiring. You can use Auth0 Actions instead, specifically Post User Registration or Post Login. The role assignment happens during the authentication flow, which means that when the user is redirected back to your application, the tokens issued by Auth0 will already contain the newly assigned roles.

If you have any other questions, feel free to reach out.

Have a good one,  
Vlad

---

<div class="post-metadata">

**Author:** ![baynezy](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/baynezy/32/49885_2.png) [@baynezy](https://community.auth0.com/u/baynezy)\
**Post date:** [June 24, 2025, 8:12am UTC](https://community.auth0.com/t/assigning-different-roles-to-a-user-based-on-registration-path/188306/4 "2025-06-24T08:12:37Z")

</div>

Thanks @vlad.murarasu - I am using Blazor WASM. So I will have to try and work out how do the equivalent of that in .Net.

Cheers.

---

<div class="post-metadata">

**Author:** ![baynezy](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/baynezy/32/49885_2.png) [@baynezy](https://community.auth0.com/u/baynezy)\
**Post date:** [June 30, 2025, 1:22pm UTC](https://community.auth0.com/t/assigning-different-roles-to-a-user-based-on-registration-path/188306/5 "2025-06-30T13:22:04Z")

</div>

To do this in Blazor WASM. You need to use `InteractiveRequestOptions`.

```csharp
        var parameters = new Dictionary<string, object>
        {
            {"ext-user-type", "Example"}
        };
        var options = new InteractiveRequestOptions
        {
            Interaction = InteractionType.SignIn,
            ReturnUrl = Navigation.Uri
        };
        
        options.TryAddAdditionalParameter("extraQueryParams", parameters);
        
        Navigation.NavigateToLogin("authentication/login", options);

```

You can then grab this in the Post Login Action in the `event.request.query` object.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 14, 2025, 1:22pm UTC](https://community.auth0.com/t/assigning-different-roles-to-a-user-based-on-registration-path/188306/6 "2025-07-14T13:22:38Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
