Anyone with experience troubleshooting Duo Oauth w...
# citrix-netscaler
r
Anyone with experience troubleshooting Duo Oauth with NetScaler AAA? We have everything setup from what I can tell. If I tail the ns.log we see this error "AAA Client Handler: Found extended error code 1310727, ReqType 16386 request" which seems to indicate that the response from the Oauth did not contain a valid token. But every indicated problem we've double checked is not happening. Ideas?
j
Can the NSIP get to the internet to validate the token?
r
Yes. The outbound rule permits all IP addresses in the subnet to access *.duosecurity.com on 443
j
Check this line. I had done some configs from CLI, and the ? was getting removed from the url in the OAUTH config. -authorizationEndpoint "https://api-<your API>.duosecurity.com/oauth/v1/authorize\?scope=openid"
r
Yes, the question mark is there and the "\" does not belong unless you are doing it from the CLI as it will not keep the "?" without the "|" escape character
j
<Login Schema to capture Username and Password>
add authentication loginSchema LSCHEMA_PROFILE_OAUTH_DUO -authenticationSchema "/nsconfig/loginschema/LoginSchema/SingleAuth.xml" -userCredentialIndex 15 -passwordCredentialIndex 16 -SSOCredentials YES
add authentication loginSchemaPolicy LSCHEMA_POLICY_OAUTH_DUO -rule true -action LSCHEMA_PROFILE_OAUTH_DUO
<OAuth Action for Duo>
add authentication OAuthAction AUTH_ACTION_OAUTH_DuoAuthenticationProxy -authorizationEndpoint "https://api-<your API>.duosecurity.com/oauth/v1/authorize\?scope=openid" -tokenEndpoint "https://api-<your API>.duosecurity.com/oauth/v1/token" -clientID <Your ID> -clientSecret <Your Secret> -OAuthMiscFlags EnableJWTRequest -PKCE DISABLED -tokenEndpointAuthMethod client_secret_jwt
<Policy for LDAP and OAuth>
add authentication Policy AUTH-LDAP -rule true -action <LDAP Action>
add authentication Policy AUTH_POLICY_OAUTH_DUO -rule true -action AUTH_ACTION_OAUTH_DuoAuthenticationProxy
<Policy Label for OAuth>
add authentication policylabel AUTH_POLICYLABEL_OAUTH_DuoAuthenticationProxy -loginSchema LSCHEMA_INT
bind authentication policylabel AUTH_POLICYLABEL_OAUTH_DuoAuthenticationProxy -policyName AUTH_POLICY_OAUTH_DUO -priority 100 -gotoPriorityExpression NEXT
<AAA Virtual Server>
add authentication vserver AAA_VS_DuoOauth SSL 0.0.0.0
bind authentication vserver AAA_VS_DuoOauth -policy LSCHEMA_POLICY_OAUTH_DUO -priority 100 -gotoPriorityExpression END
bind authentication vserver AAA_VS_DuoOauth -policy AUTH-LDAP -priority 100 -nextFactor AUTH_POLICYLABEL_OAUTH_DuoAuthenticationProxy -gotoPriorityExpression NEXT
bind ssl vserver AAA_VS_DuoOauth -certkeyName <SSL Certificate>
<Authentication Profile bound to new AAA Virtual Server>
add authentication authnProfile AUTH_PROFILE_LDAP_OAUTH_DUO -authnVsName AAA_VS_DuoOauth
<Traffic Policies for SSON with custom login schema positions>
add vpn trafficAction VPN_TF_PROFILE_OAUTH_DUO http -SSO ON -userExpression "AAA.USER.ATTRIBUTE(15)" -passwdExpression "AAA.USER.ATTRIBUTE(16)"
add vpn trafficPolicy VPN_TF_POLICY_OAUTH_DUO true VPN_TF_PROFILE_OAUTH_DUO
bind vpn vserver <VPN Server Name> -policy VPN_TF_POLICY_OAUTH_DUO -priority 100 -gotoPriorityExpression END -type REQUEST
Duo AuthProxy iframe fix for 14.1
add rewrite action delete_cors_header_1_act delete_http_header Cross-Origin-Opener-Policy
add rewrite action delete_cors_header_2_act delete_http_header Cross-Origin-Embedder-Policy
add rewrite action delete_cors_header_3_act delete_http_header Cross-Origin-Resource-Policy
add rewrite policy delete_cors_header_1_pol true delete_cors_header_1_act
add rewrite policy delete_cors_header_2_pol true delete_cors_header_2_act
add rewrite policy delete_cors_header_3_pol true delete_cors_header_3_act
bind vpn vserver <VPN VServer> -policy delete_cors_header_1_pol -priority 100 -gotoPriorityExpression NEXT -type RESPONSE
bind vpn vserver <VPN VServer> -policy delete_cors_header_2_pol -priority 110 -gotoPriorityExpression NEXT -type RESPONSE
bind vpn vserver <VPN VServer> -policy delete_cors_header_3_pol -priority 120 -gotoPriorityExpression NEXT -type RESPONSE
That is my template for creating DUO Oauth connections. I am sure you probably have all of them.
r
I do not. Thank you. iframe is not in use so we don't need that one
j
Biggest problems I have seen are NSIP/SNIP in management network needing Internet and DNS access, Username and Password being overwritten, so moving them to different customer attributes.
Oh, yeah, ignore the iframe stuff, copied too much. 😉
r
I'll try the different attribute. And the traffic policies we are not using yet
👍 1
j
not duo/netscaler, but when i had trouble with auth0 via postman last week, it was due multiple scopes (openid profile and email) being comma separated in my json vs space separated (should have been just space). similar 401 error at the idp
looks like i never hit enter earlier for the above
s
We have Gateway behind GSLB, upgraded NetScaler in one DC to the latest version (14.1 build 60.52) due to UDP audio issues with earlier firmware (14.1 build 56.74). Duo OAuth is broken with the latest firmware, working with older firmware. We are getting invalid algorithm error and HS512 is used which is not a supported algorithm on the NetScaler. "OAUTH: verify JWT: Invalid algorithm <HS512> found, cannot verify jwt" "OAUTH: failed to verify JWT;"
r
Really. I'll have to see if the new one today fixed it