Posit connect error with MS Azure oauth2

I configured Posit Connect to use MS Azure to login the domain users.
The access to the server is : https://myserver.com:443
The callback URL configured in Azure is: https://myserver:443/__login__/callback

I am getting the following error:
"OAuth2 handling error trying to generating redirect URL: Get "https://login.microsoftonline.com/{tenant id}/v2.0/.well-known/openid-configuration": dial tcp 20.190.159.4:443: i/o timeout"

and

" level=warning msg="Warning: Authentication took longer than 10 seconds, this may be indication of a problem with your authentication provider. Please review the logs. Enabling the OAuth2.Logging configuration option may provide further details to diagnose this condition."

The server is behind a corporate proxy and the environment variables (HTTPS_PROXY and https_proxy) are set in /etc/environment. "curl -vk login.microsoftonline.com" and "curl -vk graph.microsoft.com" works from the command line, so the server is accessing azure.

Is there any parameter which I can direct the server to login to azure through the proxy?

Can anybody help me?
Thanks in advance !

You probably have to set the proxy related environment variables in the systemd service file since /etc/environment is not read there, c.f. How to set environment variable in systemd service? - Server Fault for the mechanics of that.

1 Like

In that case it would be useful to see a diagnostics report, which you probably don't want to share here. Can you please create a ticket with our support team, c.f. https://support.posit.co/hc/en-us/articles/360004788294-How-do-I-submit-a-Support-ticket

1 Like

I did it correctly now. Solved my problem. Thanks rstub !
Had to sudo systemctl edit rstudio-connect and put the environment variables there:

Environment="ftp_proxy=http://myproxy.com:8080"
Environment="FTP_PROXY=http://myproxy.com:8080"
Environment="http_proxy=http://myproxy.com:8080"
Environment="HTTP_PROXY=http://myproxy.com:8080"
Environment="https_proxy=http://myproxy.com:8080"
Environment="HTTPS_PROXY=http://myproxy.com:8080"
Environment="all_proxy=http://myproxy.com:8080"
Environment="ALL_PROXY=http://myproxy.com:8080"
Environment="NO_PROXY=no_proxy=localhost,127.0.0.1,myserver.com"
Environment="no_proxy=no_proxy=localhost,127.0.0.1,myserver.com"

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.