cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Button to Sign-Off URL Filter

Hello Power BI developers,

 

I'm embedding my report with Iframe and as I know there are some possibilities to make some button with low-code.

I want to make button to sign-off current signed user.

 

If it is possible then please give me any idea.

Plus, if any code snippet to make button to sign-in will be appreciated as well.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Button to Sign-Off URL Filter

Hi @DanielLinda ,

 

We create a sample to add a button in html, when click it, it will open a sign-out tab, it can be achieved better by using js script to call a background http request to sign out.

 

<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Sign Out Power BI</title>
</head>

<body>
<script src="js/scripts.js"></script> 
<H1> Signout Test</H1>

<a href="https://app.powerbi.com/Signout" target='_blank'>
 <button type="button"> Signout Current User </button>
</a>
<br />

<iframe width="1140" height="541.25" src="https://app.powerbi.com/reportEmbed?reportId=XXX&autoAuth=true&ctid=XXX&config=XXX" frameborder="0" allowFullScreen="true"></iframe>

</body>
</html>

 

the signout request will like following:

 

curl 'https://app.powerbi.com/Signout' \
  -H 'authority: app.powerbi.com' \
  -H 'pragma: no-cache' \
  -H 'cache-control: no-cache' \
  -H 'upgrade-insecure-requests: 1' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36' \
  -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \
  -H 'sec-fetch-site: cross-site' \
  -H 'sec-fetch-mode: navigate' \
  -H 'sec-fetch-user: ?1' \
  -H 'sec-fetch-dest: document' \
  -H 'referer: https://login.microsoftonline.com/' \
  -H 'accept-language: en;q=0.9,zh;q=0.8' \
  -H 'cookie: ASP.NET_SessionId=XXXXXXX; ARRAffinity=XXXXXXXXX; PreferredLanguage=; ai_user=MCng0|2020-05-20T03:04:08.184Z; ClusterUri=XXXXXXXXX=https://XXXX-XXXXX-east-redirect.analysis.windows.net/; OpenIdConnect.nonce.XXXXX; ai_session=Uluum|XXXX|XXXX.105; LoginErrorReattemptCount=2; WFESessionId=XXXXX' \
  --compressed

 

4.jpg3.jpg


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Super User IV
Super User IV

Re: Button to Sign-Off URL Filter

No idea if this would work but maybe a link to a web page that does the sign-off? What are you signing them off of?


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Community Support
Community Support

Re: Button to Sign-Off URL Filter

Hi @DanielLinda ,

 

Based on my test, if visit "https://app.powerbi.com/Signout" , it will sign out the user of power bi, how about make a button which have hyperlink to the https://app.powerbi.com/Signout. When click the button, it will open a new tab and the current power bi page will signout in few seconds.

 

5.jpg6.jpg

 

Or create the button outside the report, it should do the same thing.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper IV
Helper IV

Re: Button to Sign-Off URL Filter

For example, I want to make button to sign-off current user in below page.

I'm using html file with Iframe to connect this page.

image.png

Highlighted
Community Support
Community Support

Re: Button to Sign-Off URL Filter

Hi @DanielLinda ,

 

We create a sample to add a button in html, when click it, it will open a sign-out tab, it can be achieved better by using js script to call a background http request to sign out.

 

<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Sign Out Power BI</title>
</head>

<body>
<script src="js/scripts.js"></script> 
<H1> Signout Test</H1>

<a href="https://app.powerbi.com/Signout" target='_blank'>
 <button type="button"> Signout Current User </button>
</a>
<br />

<iframe width="1140" height="541.25" src="https://app.powerbi.com/reportEmbed?reportId=XXX&autoAuth=true&ctid=XXX&config=XXX" frameborder="0" allowFullScreen="true"></iframe>

</body>
</html>

 

the signout request will like following:

 

curl 'https://app.powerbi.com/Signout' \
  -H 'authority: app.powerbi.com' \
  -H 'pragma: no-cache' \
  -H 'cache-control: no-cache' \
  -H 'upgrade-insecure-requests: 1' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36' \
  -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \
  -H 'sec-fetch-site: cross-site' \
  -H 'sec-fetch-mode: navigate' \
  -H 'sec-fetch-user: ?1' \
  -H 'sec-fetch-dest: document' \
  -H 'referer: https://login.microsoftonline.com/' \
  -H 'accept-language: en;q=0.9,zh;q=0.8' \
  -H 'cookie: ASP.NET_SessionId=XXXXXXX; ARRAffinity=XXXXXXXXX; PreferredLanguage=; ai_user=MCng0|2020-05-20T03:04:08.184Z; ClusterUri=XXXXXXXXX=https://XXXX-XXXXX-east-redirect.analysis.windows.net/; OpenIdConnect.nonce.XXXXX; ai_session=Uluum|XXXX|XXXX.105; LoginErrorReattemptCount=2; WFESessionId=XXXXX' \
  --compressed

 

4.jpg3.jpg


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper IV
Helper IV

Re: Button to Sign-Off URL Filter

Thanks @v-lid-msft,

 

I might use your code and it will be enough.

 

Thanks for your kind support.

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021