1

I found vignette on using the AzureAuth package with Shiny which seems to be a modified version of this httr Sketch of shiny + oauth.

It's unclear, to me at least, how to connect the names in that guide to what I can find in my Azure Portal.

That guide asks for tenant, app, resource, and redirect.

I presume that for tenant and app I should use the IDs from here:

Azure portal screen shot

For resource, do I leave in the c("https://management.azure.com/.default", "openid") or do I change it to the endpoints found in the portal, ie. https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/authorize?

I changed it to just "openid".

Should the redirect variable be the URL of my app, the callback URL or something else?

ie. https://myapp.azurewebsites.net or https://myapp.azurewebsites.net/.auth/login/aad/callback

I'm going with the former. This is all in a docker container using rocker as the base.

With all this I'm getting 500 errors after I authenticate. Of course, Azure has middleware inbetween my container and the exposed internet that is redirecting to their login regardless of anything in my code. The problem is in the handoff from being authenticated to the callback. That's where things seem to break.

Edit: Turns out I was barking up the wrong tree entirely. The problem I was having was this...

Query/headers too large on Azure if auth enabled

R Shiny app on Azure App Services with Active Directory Integration

Dean MacGregor
  • 11,847
  • 9
  • 34
  • 72
  • Can you try updating your redirect uri in the portal with https://myapp.azurewebsites.net/.auth/login/aad/callback. And then change the redirect uri in the code as https://myapp.azurewebsites.net/.auth/login/aad/callback – RamaraoAdapa Nov 23 '21 at 12:59

1 Answers1

0

Should the redirect variable be the URL of my app, the callback URL or something else? ie. https://myapp.azurewebsites.net or https://myapp.azurewebsites.net/.auth/login/aad/callback

Firstly, change the redirect URI in your app registration in the portal as follow:

https://myapp.azurewebsites.net/.auth/login/aad/callback

enter image description here

Now, change the redirect variable in your app code as follow:

https://myapp.azurewebsites.net/.auth/login/aad/callback

RamaraoAdapa
  • 2,837
  • 2
  • 5
  • 11