How to: Configure OAuth Federation policies using BIG-IP Central Manager

Using BIG-IP Next Central Manager GUI to create a policy

The following example creates a new Create OAuth Federation policy using the BIG-IP Next Central Manager user interface.

  1. Log in to BIG-IP Next Central Manager. Navigate to the Security canvas > Security > Access > Policies path.

  2. To create a policy, click the Start Creating button. By default, there are no policies created. The Create Policy page opens, and the Visual Policy Designer (VPD) canvas appears.

  3. Select the required policy type radio button. Available policy options are the Per-Session Policy and Per-Request Policy.

  4. In The How would you like to create it? section, select whether to create a policy using the template or from scratch. Available options are Create using a policy template and Start from scratch. Users are recommended to select Create using a policy template option to quickly access the policy.

  5. In the Policy Templates section, select the required policy template. Available options are Logon Page with Active Directory Query and SAML as a Service Provider. When the Logon Page with Active Directory Query is selected, this policy template includes a Logon Page and Active Directory rules for Authentication and Authorization purposes. When the SAML as a Service Provider is selected, this policy template includes SAML Federation and Variable Assign rules to configure for a SAML Service Provider setup.

  6. Click Next. Based on the selection of the policy type, the applicable policy configurations are displayed.

  7. On the General Properties tab, enter a Policy Name for the policy.

  8. Scroll through the remaining properties and revise any value that you want to change from its default setting.

  9. Click Continue. The Session Properties tab of the respective policy page appears.

  10. On the Session Properties tab, scroll through the properties and revise any value that you want to change from its default setting.

  11. Click Continue. The Logging tab of the respective policy page appears.

  12. On the Logging tab, scroll through the properties and revise any value that you want to change from its default setting.

  13. Click Continue. The Single Sign-On tab of the respective policy page appears.

  14. The Single Sign-On (SSO) provides seamless access to the applications protected through BIG-IP Next Access. This allows administrators to use more modern authentication techniques, such as SAML or OAuth, and translate it to something the back-end application supports, such as Kerberos or Forms.

  15. On the Single Sign-On tab, click Start Creating to select the required authentication type. Available options are Forms, Forms Client-Initiated, HTTP Basic, Kerberos, and OAuth Bearer. When one of the authentication types is selected, its respective configuration page appears. Fill in the required values in the given fields and save the configuration.
    Refer to Single Sign-On methods for more information.

  16. Click Continue. The Endpoint Security tab of the respective policy page appears.

  17. On the Endpoint Security tab, choose the applicable version from its default setting.

  18. Click Continue. The Resources tab of the respective policy page appears.

  19. The Resources extend BIG-IP Next Access with additional capabilities such as Network Access, Access Control, Identity Providers, and Webtops.

  20. On the Resources tab, click Start Creating to select the required resource. Available options are Access Control List, Network Access, Webtop, and Webtop Section.

  21. Click Continue. The Connectivity tab of the respective policy page appears.

  22. On the Connectivity tab, scroll through the properties and revise any value that you want to change from its default setting.

  23. Click Continue. The Policy Endings tab of the respective policy page appears.

  24. On the Policy Endings tab, scroll through the properties and revise any value that you want to change from its default setting.

  25. Click Finish. A required access policy is created.
    The VPD canvas opens.

    Note: Prior to establishing the Authentication rule, ensure that you have generated valid Certificate Authority Signed (CSA) SSL certificates. For detailed guidance on certificate management, refer to How to: Manage certificates and keys for a BIG-IP Next instance using BIG-IP Next Central Manager.

  26. Drag an empty flow into the VPD canvas.

  27. On the empty flow, click the Expand icon.
    The flow expands so you can edit it.

  28. On the VPD side bar, click the Rule icon, and then drag the OAuth Federation rule onto the empty flow.

  29. Hover the cursor over the OAuth Federation rule and then click the Edit icon.
    The Rule Properties tab of the Rule Configuration page opens.

    1. For Mode, select whether you want to configure this rule as a Client or a Resource Server.

      • If you select Client, you create a configuration that allows BIG-IP Next Access to obtain opaque or JSON web tokens (JWTs) from an OAuth authorization server that supports them. It specifies endpoint URIs to retrieve the token and a list of associated scopes.

      • If you select Resource Server, you specify settings for an OAuth Authorization server and its mode of operation. You also set the client IDs, client secrets, and SSL certificates that BIG-IP Next Access requires to communicate with the OAuth provider.

    2. For Name, specify the name for this rule. You can specify a name or use the name that auto-generates when you insert the rule into the policy.

    3. For Grant Type, select authorization-code. The valid values are:

      • authorization-code: the client redirects the resource owner to the OAuth server to request an authorization code.

      • password: the client uses resource owner password credentials to request an access token from the OAuth server.

    4. For Vendor Presets, select the type of presets that you want to have filled in for you automatically when you configure the OAuth provider.
      Note To specify your own presets, select the Custom option.

    5. For Scope, specify the URI for the OAuth server to redirect back to the client. This is an optional field. You can specify one or more scopes. Enter the value as a list of space-delimited, case-sensitive strings. The strings are defined by the OAuth authorization server.

    6. For OpenID Connect, select Enabled.

    7. For Flow Type, select Authorization Code and then click Continue.
      The Providers tab of the Rule Configuration screen opens.

    8. Under OAuth Provider, click Start Creating.
      The Provider Properties tab of the Provider Configuration page opens.

      1. For Name, specify the name for this provider. You can specify one or use the auto-generated name.

      2. For Redirect URI, use the default value.

      3. Select Enable Auto Discovery.

      4. For OpenID URI, specify the URI for your authorization server provider, and then click Discover.
        BIG-IP Next Central Manager validates the URI and displays a Discovery Successful notification. If discovery is unsuccessful, correct your entry and try again.

      5. Select Support Introspection. Token introspection allows a protected resource to query the authorization server to determine the metadata associated with the token.

      6. Click Continue.
        The JWT Configuration tab of the Provider Configuration page opens.

      7. To validate tokens when the certificate that signs those tokens is expired, select Ignore Expired Certificate Validation.

      8. To enable self-signed certificates, select Allow Self-Signed JWK Config Certificate.
        Note, because Enable Auto Discovery is enabled, No entry is required for Trusted Certificate Authorities and Issuer.

      9. For Access Token Expiration (minutes) specify the number of minutes that the JSON web token should remain alive. If you never want the token to expire, specify 0.

      10. To restrict access to specific servers, for Audience, click Create and then paste in the URI from the Redirect URI field on the previous screen. To add more servers, click Create again.
        Note: Because Enable Auto Discovery is enabled, the Signing Algorithms and JSON Web Keys fields are auto-filled and disabled.

      11. Click Finish.
        Summary information for the Provider you just configured opens.

    9. Under Authorization Server, click Start Creating.
      The Server Properties tab of the Server Configuration page opens.

      1. For Name, specify the name for this server. You can specify one, or use the auto-generated name.

      2. For Mode, select Client.

      3. For Token Validation Interval (in minutes), specify the number of minutes that the token can remain valid. The token becomes invalid when this interval elapses, or at the token expiry that the authentication server specifies, whichever is shorter. When the token expires, the subsession times out. This setting applies only to a per-request policy. The default value is 60.
        Note: It is recommended to use short expiry values for the Authorization Code Lifetime setting in the Authorization server to protect against attacks.

      4. Click Continue.
        The Client Settings tab of the Server Configuration page opens.

      5. For Client ID, specify the application ID for the client.
        Note: You can get the Client ID and Client Secret from your authorization server settings.

      6. For Client Secret, specify the application secret for the client.

      7. For Cipher String, specify the cipher string for server-side SSL communications. The default value is DEFAULT.

      8. Under TLS Options, select the versions of TLS that you want to support.

    10. Click Finish, then click Continue.
      The Branches tab of the Rule Configurations page opens.

  30. Under Branches, click Create.
    The Branches page opens.

  31. Under Expression, select a Context, a Condition and a Result for this branch.

  32. Add any (optional) branches needed for the policy, and then click Finish.
    The VPD canvas displays the revised policy.

  33. Review the policy in the VPD canvas; then click Save to finish creating the policy.
    BIG-IP Next Central Manager adds the policy to the Access Policies list.

Using the BIG-IP Next Central Manager API to create a policy

The following example creates a new OAuth Federation Access policy using the BIG-IP Next Central Manager application programming interface (API).

  1. Authenticate with the BIG-IP Next Central Manager API. For details refer to How to: Authenticate with the BIG-IP Next Central Manager API.

  2. Create the policy by sending a Post to the /api/v1/spaces/default/security/access-policies endpoint.

    POST https://<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/security/access-policies
    

    For the API body, use the following, substituting values appropriate for the policy you want to create.

    {
     "description": "",
     "name": "Oauth_clientserver",
     "policy_type": "PerSession",
     "properties": [
         {
             "configuration": {
                 "policyType": "PerSession",
                 "name": "Oauth_clientserver",
                 "externalServers": [
                     {
                         "dnsResolverName": "global_f5_internal_net_resolver",
                         "clientTls": {
                             "cipherstring": "DEFAULT",
                             "tlsVersions": {
                                 "enableTLS1.1": false,
                                 "enableTLS1.2": true,
                                 "enableTLS1.3": true
                             }
                         },
                         "name": "OAuth-Server-17a18166",
                         "mode": "client",
                         "serverType": "Oauth",
                         "overrideVendorPresets": true,
                         "providerName": "OAuth-Provider-d1230bf5",
                         "tokenValidationInterval": 60,
                         "clientId": "asdfg",
                         "clientSecret": "asdfg"
                     },
                     {
                         "authenticationUri": "https://f5-oauth.local/f5-oauth2/v1/authorize",
                         "enableAutoDiscovery": false,
                         "name": "OAuth-Provider-d1230bf5",
                         "providerType": "f5",
                         "serverType": "OauthProvider",
                         "tokenUri": "https://f5-oauth.local/f5-oauth2/v1/token",
                         "tokenValidationScopeUri": "https://f5-oauth.local/f5-oauth2/v1/introspect",
                         "userinfoRequestUri": "https://f5-oauth.local/f5-oauth2/v1/userinfo",
                         "introspect": "supported",
                         "ignoreExpiredCert": true,
                         "allowSelfSignedJwkCert": false,
                         "jwtConfig": {
                             "issuer": "clouddocs.com",
                             "accessTokenExpiresIn": 0,
                             "audience": [],
                             "allowedSigningAlgorithms": [
                                 "HS256"
                             ],
                             "blockedSigningAlgorithms": [],
                             "allowedKeys": [
                                 {
                                     "keyType": "elliptic-curve",
                                     "keyId": "c0b8e0d8395a0f4a",
                                     "algType": "ES256",
                                     "cert": "g1"
                                 }
                             ],
                             "blockedKeys": []
                         },
                         "openIdUri": "https://f5-oauth.local/f5-oauth2/v1/.well-known/openid-configuration"
                     }
                 ],
                 "policy": {
                     "objectContent": {
                         "macros": [
                             {
                                 "name": "Emptyd07acae6",
                                 "start": {
                                     "name": "OAuth-Federation-422d2d18",
                                     "nextItems": [
                                         {
                                             "itemType": "terminal-out",
                                             "name": "Allow",
                                             "caption": "Branch-d8ab2dac",
                                             "expression": "expr {[mcget {session.oauth.authz.last.result}] == 1}"
                                         },
                                         {
                                             "caption": "Fallback",
                                             "itemType": "terminal-out",
                                             "name": "Deny"
                                         }
                                     ],
                                     "itemType": "oauth-client",
                                     "ruleType": "oauth-client",
                                     "ruleId": "OAuth-Federation-052db959",
                                     "oauthServer": "OAuth-Server-17a18166",
                                     "caption": "Fallback",
                                     "grantType": "authorization-code",
                                     "openidConnect": true,
                                     "openidFlowType": "code",
                                     "requestAuthRedirect": {
                                         "headers": [],
                                         "method": "get",
                                         "parameters": [
                                             {
                                                 "name": "client_id",
                                                 "type": "client-id",
                                                 "value": ""
                                             },
                                             {
                                                 "name": "response_type",
                                                 "type": "response-type",
                                                 "value": ""
                                             },
                                             {
                                                 "name": "redirect_uri",
                                                 "type": "redirect-uri",
                                                 "value": ""
                                             },
                                             {
                                                 "name": "scope",
                                                 "type": "scope",
                                                 "value": ""
                                             },
                                             {
                                                 "name": "token_content_type",
                                                 "type": "custom",
                                                 "value": "jwt"
                                             }
                                         ]
                                     },
                                     "requestOpenidUserinfo": {
                                         "headers": [
                                             {
                                                 "name": "Authorization",
                                                 "value": "Bearer %{session.oauth.client.last.access_token}"
                                             }
                                         ],
                                         "method": "get",
                                         "parameters": []
                                     },
                                     "requestToken": {
                                         "headers": [],
                                         "method": "post",
                                         "parameters": [
                                             {
                                                 "name": "client_id",
                                                 "type": "client-id",
                                                 "value": ""
                                             },
                                             {
                                                 "name": "client_secret",
                                                 "type": "client-secret",
                                                 "value": ""
                                             },
                                             {
                                                 "name": "grant_type",
                                                 "type": "grant-type",
                                                 "value": ""
                                             },
                                             {
                                                 "name": "redirect_uri",
                                                 "type": "redirect-uri",
                                                 "value": ""
                                             },
                                             {
                                                 "name": "token_content_type",
                                                 "type": "custom",
                                                 "value": "jwt"
                                             }
                                         ]
                                     },
                                     "requestRefreshToken": {
                                         "headers": [],
                                         "method": "post",
                                         "parameters": [
                                             {
                                                 "name": "client_id",
                                                 "type": "client-id",
                                                 "value": ""
                                             },
                                             {
                                                 "name": "client_secret",
                                                 "type": "client-secret",
                                                 "value": ""
                                             },
                                             {
                                                 "name": "grant_type",
                                                 "type": "custom",
                                                 "value": "refresh_token"
                                             }
                                         ]
                                     },
                                     "scope": "",
                                     "redirectionUri": "https://%{session.server.network.name}/oauth/client/redirect",
                                     "isValid": true
                                 },
                                 "endings": [
                                     {
                                         "name": "Deny",
                                         "color": "#D9647A",
                                         "default": true
                                     },
                                     {
                                         "name": "Allow",
                                         "color": "#199D4D"
                                     }
                                 ]
                             }
                         ],
                         "start": {
                             "itemType": "macro-call",
                             "name": "OAuthclientrule",
                             "macro": "Emptyd07acae6",
                             "caption": "Fallback",
                             "nextItems": [
                                 {
                                     "itemType": "deny",
                                     "name": "Deny",
                                     "caption": "Deny"
                                 },
                                 {
                                     "itemType": "allow",
                                     "name": "Allow",
                                     "caption": "Allow"
                                 }
                             ]
                         },
                         "endings": [
                             {
                                 "name": "Deny",
                                 "action": "deny",
                                 "color": "#D9647A",
                                 "default": true
                             },
                             {
                                 "name": "Allow",
                                 "action": "allow",
                                 "color": "#199D4D",
                                 "default": false
                             }
                         ],
                         "languages": [
                             "en"
                         ],
                         "defaultLanguage": "en"
                     }
                 },
                 "scope": "profile",
                 "profileType": "all",
                 "userIdentityMethod": "http",
                 "connectivityAccessPolicyName": "Oauth_clientserver_cap",
                 "timeout": 300,
                 "inactivityTimeout": 900,
                 "maxSessionTimeout": 604800,
                 "maxConcurrentUsers": 0,
                 "maxConcurrentSessions": 0,
                 "maxInProgressSessions": 128,
                 "minFailureDelay": 2,
                 "maxFailureDelay": 5,
                 "domainCookie": "",
                 "secureCookie": false,
                 "persistentCookie": false,
                 "httpOnlyCookie": false,
                 "restrictToSingleClientIP": false,
                 "useHttp503OnError": false,
                 "logoutUriTimeout": 5,
                 "samesiteCookie": false,
                 "samesiteCookieAttrValue": "strict"
             },
             "connectivityProfileConfiguration": {
                 "compressBufferSize": 4096,
                 "compressGzipLevel": 6,
                 "compressGzipMemlevel": 8192,
                 "compressGzipWindowsize": 16384,
                 "compressCpusaver": true,
                 "compressCpusaverHigh": 90,
                 "compressCpusaverLow": 75,
                 "compressionAdaptive": true,
                 "compressionDeflateLevel": 1,
                 "compressionCodecs": [],
                 "pppTunnel": {
                     "profilePpp": {}
                 },
                 "clientPolicy": {
                     "ecSaveServersOnExit": true,
                     "ecReuseWinlogonSession": false,
                     "ecReuseWinlogonCreds": false,
                     "ecRunLogoffScript": false,
                     "ecWarnBeforeScriptLaunch": true,
                     "ecSavePasswordMethod": "none",
                     "ecSavePasswordTimeout": 240,
                     "ecComponentUpdate": "yes",
                     "serverList": [],
                     "ecLocationDnsList": [],
                     "androidEcRequireDeviceAuth": false,
                     "androidEcSavePasswordMethod": "disk",
                     "androidEcSavePasswordTimeout": 240,
                     "iosEcRequireDeviceAuth": false,
                     "iosEcSavePasswordMethod": "disk",
                     "iosEcSavePasswordTimeout": 240,
                     "macosEcSavePasswordMethod": "disk",
                     "macosEcSavePasswordTimeout": 240,
                     "chromeosEcSavePasswordMethod": "disk",
                     "chromeosEcSavePasswordTimeout": 240,
                     "chromeosEcLogonMethod": "native",
                     "macosEcLogonMethod": "native",
                     "name": "Oauth_clientserver_cap_clientPolicy"
                 },
                 "name": "Oauth_clientserver_cap",
                 "policyType": "ConnectivityAccessPolicy"
             },
             "loggingConfiguration": [
                 {
                     "component": "apmd",
                     "level": "NOTICE"
                 },
                 {
                     "component": "tmm",
                     "level": "NOTICE"
                 },
                 {
                     "component": "websso",
                     "level": "NOTICE"
                 },
                 {
                     "component": "renderer",
                     "level": "NOTICE"
                 }
             ]
         }
     ]
     }
    

    BIG-IP Next Central Manager creates the policy specified by the parameter values used in the body of your POST.

    Important: To fully configure this policy, attach this rule to an application. After attaching to an application, make sure to configure the DNS Resolver and External or AAA servers as well for OAuth Federation. For additional details about managing an application, refer to How to: Manage applications using BIG-IP Next Central Manager and FAST templates.