Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dattapawar
Regular Visitor

Prompt user to provide the credentials

I would like to show the a prompt/popup/daialouge box that will ask user to provide the credentials.

 

I am using power bi desktop and powerbi cloud service.

I am working on a report that collects data from rest api, which needs to be autheticated.

I have created two parameters UserName and Password and using same within power query. 

Here is the query I have formed. In the data source settings I have set the authetication as Basic.

 

let
Source = Username & ":" & Password,
Bytes = Text.ToBinary(Source),
TextForm = Binary.ToText(Bytes, BinaryEncoding.Base64),

url = "API URL",

GetJson = Json.Document(Web.Contents(url,
[
Headers = [#"Content-Type"="application/json",#"Authorization"="Basic " & TextForm]

])),

#"Converted to Table" = Record.ToTable(GetJson),
Value = #"Converted to Table"{2}[Value],
#"Converted to Table1" = Table.FromList(Value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table1", "Column1", {"Id", "Name", "Salary"},
{"Column1.Id", "Column1.Name", "Column1.Salary"}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Column1",{{"Column1.Id", "EMPID"}, {"Column1.EMPName", "EMPName"}, {"Column1.Salary", "Salary"}})
in
#"Renamed Columns"

 

While refresh the report or reopen of report, no prompt box is there. I observed that query stores the user name and password provided in datasource settings.

 

Is there a way  to prompt the user for credentials and get the provided input into paramaters? like username and password.

5 REPLIES 5
dax
Community Support
Community Support

Hi dattapawar,

As I know, when use built-in connector, you will pass and store the credential in dataset, you couldn't achieve this goal currently. You might need to create the custom connector to see whether it work or not. Or you could ask super users in forum for more suggestions.

 

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you for the reply.

 

Please provide the link(s) where I could learn on Custom connector creation.

 

zoloturu
Memorable Member
Memorable Member

@dattapawar ,

 

You can't have a dialog box in Power BI Desktop and Service.

The only option is to create two parameters UserName and Password and use them in your PowerQuery code. And once user wants to use your report he can go to Edit Parameters menu in Desktop and enter them. 

 

See where located edit parameters in Desktop and Service - https://docs.microsoft.com/en-us/power-bi/service-parameters.

 


Regards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
It was useful? Press Thumbs Up!

You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups

Thank you for the reply.

 

I do have UserName and Password as parameter. While creating parameter if I make parameter as required, parameter has to have value at design time only. Later on power bi doesn't prompt for parameter input. Seems the parameter values are static in power bi.

It means that without providing any input user could see the report and which not good practise.

 

Moreover end user would be non-techi guys, so I do not wanted to drag them to edit the parameter values.

 

Please let me know if you have more pointers.

 

Thanks aagain ! 

Did you find an answer to this? I have the same problem.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors