0
votes

I'm currently trying to enable Authentication via Azure Active Directory for a Jenkins that's running via Azure's Virtual Machine service (not App Services). I've used Microsoft's tutorial on setting up the server as well as installing the Azure AD plugin and following the instructions the plugin page to set up the authentication. I've almost got it working, but when actually trying to login, I get the following error message:

AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: '<GUID goes here>'

Upon a closer look, there's a mismatch with the reply URL because the Jenkins server is currently using HTTP while the reply URL is using HTTPS. Since a reply URL must be HTTPS, I'm currently trying to enable HTTPS for the Jenkins server. In my research, most of it involves App Services, but I'm mainly trying to enable it for virtual machines.

When I tried this in AWS, I learned that you couldn't use tools that supply a free SSL certificate since the virtual machine could be swapped out at anytime. I'm not sure if Azure has the same behavior.

Can I use one of the free tools like LetsEncrypt or do I need to buy an SSL certificate for the case of virtual machines?

1
I did find the redirected URL. As stated above, there's a mismatch since the reply URL is expected to be HTTPS rather than HTTP, which is shown in the redirect_uri. Thus, I'm trying to convert the VM to use HTTPS so that there's no more mismatch. - Joseph Woolf
rejahrehim.com/blog/let%27s-encrypt/jenkins/2016/07/28/… -- you can use nginx + Let's Encrypt and reverse into your Jenkins installation (nginx will listen to HTTPS and proxy traffic to your HTTP Jenkins). Probably the sane way to do it without fighting with Jenkins. - evilSnobu
@evilSnobu so the virtual machine that's being used doesn't have a FQDN. Can I use localhost or do I need an actual FQDN? - Joseph Woolf
Upon trying run letsencrypt using the command ./letsencrypt-auto --config /etc/letsencrypt/configs/localhost.conf certonly, I get the following error: Requesting to rerun ./letsencrypt-auto with root privileges... Skipping bootstrap because certbot-auto is deprecated on this system. Your system is not supported by certbot-auto anymore. Certbot cannot be installed. - Joseph Woolf

1 Answers

0
votes

So, evilSnobu did suggest using a reverse proxy into Jenkins to get an HTTPS server up and running. While I tried the link that he provided, I had some issues with getting it working as Let's Encrypt had trouble with the Azure virtual machine.

I found Kerren Ortlepp's article to be very helpful in helping me set up a reverse proxy for Jenkins within the Azure virtual machine.