Forum Discussion
Getting logged in user from Power BI service
- Anonymous1 year ago
Hi padiga-isw,
Thank you for reaching out to Microsoft Fabric Community Forum.
Power Query M does not provide a built-in way to get the logged-in Power BI Service user dynamically.
This function Extension.CurrentCredential[Username] may return the authenticated username. It works if your connector supports OAuth or Windows Authentication.
It Does not work if Power BI Service does not pass credentials or using Anonymous authentication.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
Vinay Pabbu
Hi Akash_Varuna,
Thank you for the suggestions but I was looking at something that can get the username directly from the Power BI service, these 3 methods are not convenient because we are using Power query M language to write our custom connector so I cannot use DAX functions with it, and I couldn't find any functions or methods through which I can get the gateway logs and fetch the username from that and since a connection can have multiple users using it we can't hard code the users.
In my current configuration I am taking a optional KerberosUsername which when is filled uses Kerberos Authentication on the Trino Driver and passes KerberosUsername as the User to the Trino Driver to impersonate
CredentialConnectionString = [
AuthenticationType = "Kerberos Authentication",
UID = KerberosUsername
}Driver Configuration (KerberosUsername will be placed in the User field)Configurtion in Power BI Service new connection menu
If I set KerberosUsername while creating a new connection in Power BI service, the same credentials will be used for other users, So I want to remove this Kerberos Username field and get the username/email from Power BI service directly and pass it as the User, Please correct me if my understanding of the above solutions were wrong.
Thank you
Hi padiga-isw,
Thank you for reaching out to Microsoft Fabric Community Forum.
Power Query M does not provide a built-in way to get the logged-in Power BI Service user dynamically.
This function Extension.CurrentCredential[Username] may return the authenticated username. It works if your connector supports OAuth or Windows Authentication.
It Does not work if Power BI Service does not pass credentials or using Anonymous authentication.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
Vinay Pabbu