19

I'm trying to setup a VPN connection using a federated login with Google IdP following these instructions.

Previously, I had configured a saml-provider with Google and it worked fine to authenticate users to the AWS console through Google using ARN roles

WHen I setup the VPN connection, it successfully opens the browser and asks me to select my google account, but after selecting the account I'm getting an error message from Google

enter image description here

According to this help section

Verify that the value in the saml:Issuer tag in the SAMLRequest matches the Entity ID value configured in the SAML Service Provider Details section in the Admin console. This value is case-sensitive.

So this is a problem coming from AWS and not from me ? Is Google IdP compatible at all with VPN authentication ? (I found this doc that mentions compatibility with okta)

Edit

Thanks to some of the answers below, I managed to make it work with Google IdP. Here is a screenshot of relevant SAML Google app screens (note that for groups I ended up adding the employees department, but I guess anything else would have worked)

enter image description here

enter image description here

To be able to save an ACS URL starting with http:// in the G Suite interface, use the trick given by teknowlogist: open the inspector > network tab, perform the request to save an URL with https, then right-click copy it as cURL, replace https by http, paste in regular console, and you're good.

Cyril Duchon-Doris
  • 12,964
  • 9
  • 77
  • 164

4 Answers4

14

I found a workaround to not being able to input http://127.0.0.1:35001 as the ACS URL on the GSuite SAML app page. The Google admin console only does client-side validation for the https requirement, so you can use the Chrome console to monitor the network call made when modifying the ACS URL.

Then, you can copy this as a curl command and change https to http

teknowlogist
  • 156
  • 5
  • Hey, I seem to be able to get past the IdP login, but then the AWS VPN client says "The credentials received were incorrect. Contact your IT administrator. " any idea ? Also what did you put in the memberOf field ? Have you made it work with your G Suite ? – Cyril Duchon-Doris Aug 28 '20 at 22:57
  • 4
    Holy sh*t I had an extra trailing slash after the ACS URL, after removing and checking "signed response" in the Google Interface it now works perfectly awesome ! – Cyril Duchon-Doris Aug 28 '20 at 23:10
  • Nice! Yeah, I have it working with just G Suite. If anyone needs any more info on how my setup looks, let me know! – teknowlogist Sep 01 '20 at 14:41
  • 3
    Genius! Thanks, I added a blog post as there were still lots of other parts I didn't understand. Hopefully it helps others: https://benincosa.com/?p=3787 – vallard Dec 16 '20 at 03:55
  • I also made a video on how to do this thanks to your trick! https://youtu.be/kYJaHankFAg – vallard Dec 18 '20 at 17:28
  • The cURL hack doesn't seem to work anymore. Throws HTTP/2 stream errors. – Saeven Mar 31 '21 at 19:49
  • 2
    2021-08-12 checking in here. I was able to successfully use this workaround to use an `http` endpoint. – Michael Ambrose Aug 12 '21 at 06:32
  • 1
    2021-09-10 checking here as well. It finally works when I used curl workaround to set `http` ACS URL. However, I had trouble with Google redirection when using a browser with multiple Google accounts. This resulted in `app_not_configured_for_user` error. When I used a browser with a single account that had the VPN app assigned it started to work. – jzavisek Sep 10 '21 at 16:17
  • 1
    It has turned out that it just takes time for GSuite to propagate app configuration to user accounts and one has to then re-authenticate in the browser to propagate changes. – jzavisek Sep 10 '21 at 17:54
  • i got this error now after almost a year that this works perfectly - `The credentials received were incorrect. Contact your IT administrator.` any idea? – Amit Baranes Apr 30 '22 at 15:14
7

@Ted Schroeder —

Previous approach (or, plain Google doesn't work)

I just used a reverse proxy:

mitmproxy                                        \
  --listen-port 35000                            \
  --mode        'reverse:http://127.0.0.1:35001' \
  --set         keep_host_header=true            

If you change Google SAML's ACS URL to be https://127.0.0.1:35000 and click "Test SAML Login", Google will take you to https://127.0.0.1:35000, whose traffic will be redirected to http://127.0.0.1:35001. In the browser I get:

Authentication details received, processing details. You may close this window at any time.

However, using the SAML-tracer extension, I found that there was a URL mismatch (https://127.0.0.1:35000 vs. http://127.0.0.1:35001). Seems like the AWS VPN Client is broadcasting its expected URL as being http://127.0.0.1:35001. So this doesn't seem viable.

Current approach (or, Auth0+Google works)

I tried using Auth0 instead, and got it to work! There's a few hoops — for instance, create a new Auth0 application, go to Addons and enable SAML2 Web App, set Application Callback URL to http://127.0.0.1:35001, and then in Settings use the following:

{
  "audience": "urn:amazon:webservices:clientvpn",
  "mappings": {
    "user_id": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
    "email": "NameID",
    "name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
    "given_name": "FirstName",
    "family_name": "LastName",
    "upn": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn",
    "groups": "memberOf"
  },
  "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect",
  "signResponse": true
}

Then users, if they download the VPN config from AWS and use the AWS VPN Client app, will be taken to an Auth0 login screen where they can login via Google. Voila! (And then for security, you need to add Auth0 Rules to grant only certain users/groups authorization.)

5

I don't have a full answer yet, but I have the beginnings of one and I actually got past the 403 error above. The key to all this can be found in the AWS Client VPN information here: https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/client-authentication.html

Look for the section entitled "Service provider information for creating an app".

The key is that these are the ACS URL and the Entity ID that need to be used. Unfortunately, G Suite won't let you set the ACS URL to a non-https URL and apparently the AWS Client VPN app won't provide a secure URL for the ACS URL (where the SAML Authenticate response goes).

So, if you set the Entity ID to "urn:amazon:webservices:clientvpn" and have the G Suite SAML app in place according to the instructions, you'll get past the 403. However, since the ACS URL can't be specified you get whatever error message you're likely to get from the ACS URL that the authentication response goes to.

Example scenario

  • If you set it to https://signon.aws.amazon.com/saml" like you would for AWS Console SSO, you get an error from the AWS sign in that the SAML response was invalid.
  • And if you set it to https://127.0.0.1:35001 then you get a message from the browser that the "site can't provide a secure connection".

If anybody gets any further with this, I'd love to hear about it. In the meanwhile, I'm going to be looking into non-AWS OpenVPN clients that might actually support G Suite as a SAML IdP.


@alexandergunnarson

Since I don't have the ability to comment (thanks so much for making this easy stackOverflow) I had to edit my answer to get it past the censors.

Unfortunately, we don't have, and probably won't have for some time, G Suite Enterprise because it's too expensive for our startup environment. So OIDP is not a viable option for us now. I figured this would work. Good to know that it does.

  • Haha nice work getting around the censors! And that makes sense — we're a startup too and we just have the plain cheap GSuite offering ($10/mo/person?). But with Auth0, no need to configure the SAML stuff in Google or use SSO — Auth0 just hooks into plain Google accounts. – alexandergunnarson Aug 31 '20 at 06:20
0

I was too having the same issue. In my case, I needed to turn on the two-factor authentication for the account that I was trying to log in with.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 16 '22 at 00:04