web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to set web role to...
Power Pages
Answered

How to set web role to user logined by Google Oauth2

(0) ShareShare
ReportReport
Posted on by 39
I have followed the above post, and the user can successfully login with google mail. But I want to set permissions for that user using webrole. I guess the users will be managed in the contacts table, but I don't see any google logged in users in the contacts table.

In powerpages, how to set webrole to user logined by google authentication.
https://srinathpega.com/2022/03/25/power-apps-portal-9-portal-authenticationoauth-2-0-with-gmail/ 

Categories:
I have the same question (0)
  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @Tam5sense ,

     

    Have you checked Web Roles tab in contact table? Like by opening you contact, then on Related Tab -> Web Roles? 

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Tam5sense Profile Picture
    39 on at

    The problem is that I don't see any users in the contacts table. Whether the users logged in with sso not be stored and managed in the contacts table?

  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @Tam5sense ,

     

    When users log in with SSO, the identity provider (in this case, Google) handles the authentication process and validates the user's credentials. After successful authentication, the identity provider sends back a token to the Power Portal, confirming the user's identity. The portal can use this token to identify the user and grant access accordingly.

    In such scenarios, the user's information is not stored within the portal's local contacts table. Instead, the portal relies on the identity provider (Google) to manage and store the user's information. The portal uses the provided identity token to authenticate the user and control their access to specific portal resources.

     

    Thanks,

    Saud


    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Tam5sense Profile Picture
    39 on at

    thanks for your answer. So is there any way I can authorate for users logged in by sso? (Seem like set webrole to user in the contacts table)

  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @Tam5sense ,

     

    It's important to note that the implementation details for SSO and user authorization in a Power Portal can vary depending on the identity provider you are using (Google in this case) and the specific setup of your portal. The Power Platform provides various authentication and authorization options, and you may need to use custom code or plugins to integrate with your chosen identity provider.

     

    Here's a general outline of the steps to authorize users logged in with SSO:

    1. Obtain the Identity Provider Token: When a user logs in with SSO, the identity provider will send an authentication token back to the portal. The portal can validate this token to ensure its authenticity and extract user information from it.

    2. Extract User Attributes: From the identity provider token, you can extract relevant user attributes, such as the user's email, unique identifier, roles, or any custom claims.

    3. Map User Attributes to Portal Roles: Once you have the user attributes, you can map them to specific roles or permissions within the portal. For example, you can assign users with a specific role, such as "Customer" or "Admin," based on their attributes.

    4. Set Portal Roles or Permissions: Use the mapped user attributes to set the appropriate roles or permissions for the user within the portal. Depending on your Power Portal configuration, this may involve updating user records in the contacts table or using other mechanisms to manage user roles.

    5. Implement Authorization Logic: Throughout your portal, you can implement authorization logic to control access to certain pages, content, or functionality based on the user's assigned roles or permissions.

    For more information, please follow below link.

     

    https://learn.microsoft.com/en-us/office/dev/add-ins/develop/use-sso-to-get-office-signed-in-user-token?tabs=vs2019#run-the-add-in

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Verified answer
    Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    Your Portal User will have a Contact record in Dataverse, if claims mapping is not setup correctly or you are not forcing them to complete the Portals Profile Page you may find the Contact record has no name fields populated.

     

    External Identity providers are linked to the Contact via a Table: External Identities (note: it is possible to have multiple identities eg. if you have setup multiple providers one Contact could technically have multiple such as one for Facebook and another for Google and another for Azure AD). Technically you could trigger a real-time workflow or plugin on create of external identity and assign a Web Role (if you don't have an existing custom workflow activity or Action to assign a Web Role you would need to find one or code it yourself), but they may not get instantaneous access to the Table Permissions in the Web Role due to the Portals Caching mechanism.

  • Tam5sense Profile Picture
    39 on at

    Sorry for my stupidity, I saw google login user in contact table. Simply click on the active contacts tab

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
DP_Prabh Profile Picture

DP_Prabh 51

#2
rezarizvii Profile Picture

rezarizvii 35

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 29 Most Valuable Professional

Last 30 days Overall leaderboard