Url-based authentication?


#1

Imported Google Group message. Original thread at: https://groups.google.com/forum/#!topic/tyk-community-support/w4z61Npb3pw Import Date: 2016-01-19 21:28:28 +0000.
Sender:[email protected].
Date:Wednesday, 21 October 2015 14:23:27 UTC+1.

Am new to Tyk,

Do tyk has url-based authentication?

Can the access key could be passed via url i.e., in the get request. if any please provide the documentation for it…

Thanks in advance


#2

Imported Google Group message.
Sender:Martin Buhr.
Date:Wednesday, 21 October 2015 14:34:26 UTC+1.

Hi,

URL parameter based authentication can be done via the dashboard by setting the Auth token option to “use query string parameter” or, in the API Definition by setting auth.use_param to true.

Cheers,
Martin

  • show quoted text -

  • show quoted text -


You received this message because you are subscribed to the Google Groups “Tyk Community Support” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/c9719ad0-21aa-4cb1-9f75-33e6a54495c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


#3

Imported Google Group message.
Sender:[email protected].
Date:Wednesday, 21 October 2015 14:34:26 UTC+1.

Hi,

URL parameter based authentication can be done via the dashboard by setting the Auth token option to “use query string parameter” or, in the API Definition by setting auth.use_param to true.

Cheers,
Martin

  • show quoted text -

  • show quoted text -


You received this message because you are subscribed to the Google Groups “Tyk Community Support” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/c9719ad0-21aa-4cb1-9f75-33e6a54495c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


#4

Imported Google Group message.
Sender:Martin Buhr.
Date:Friday, 23 October 2015 12:16:02 UTC+1.

It worked… :slight_smile:

That was a quick response.
Thanks a lot


#5

@Kos @jess

Is there a way to use combo of both? First look into the header. If available ok do nothing. If not look into the query parameter and populate the header.


#6

Hi @sairam866,

Ticking the “Allow Query Parameter As Well As Header” option in the Edit API page would allow a user to make requests to your API with the auth token entered either as a query string (i.e., a GET request to localhost:8080/apiName/?Authorization={{Auth token}}) or as a normal header.

Kind regards,
Jess @ Tyk


#7

@jess

Is there a file based equivalent configuration?


#8

Hi @sairam866,

Have you tried setting the "auth"."use_param" value in your API definition to true? That should should perform a similar function as the checkbox I mentioned earlier within the REST API.

Kind regards,
Jess @ Tyk


#9

@jess

With “auth”.“use_param”=true only query is check no header is checked. The document also says the same i guess.

https://tyk.io/docs/tyk-api-gateway-v-2-0/api-management/api-definition-objects/

auth.auth_header_name: The header carrying the authentication token.

auth.use_param: This will force Tyk to look for the auth_header_name value in the URL querystring parameters instead of in the header.


#10

Tyk will look at both if you set it correctly, here’s an API definition that will look at an authorization header and then a different querystring variable:

{
    "id": "58e2ced147c4ea00011ac247",
    "name": "Double Auth",
    "slug": "double-auth",
    "api_id": "5933f523d7ca43e175098ac01222f460",
    "org_id": "5588095ea8f1bf0001000007",
    "use_keyless": false,
    "use_oauth2": false,
    "use_openid": false,
    "openid_options": {
        "providers": [],
        "segregate_by_client": false
    },
    "oauth_meta": {
        "allowed_access_types": [],
        "allowed_authorize_types": [],
        "auth_login_redirect": ""
    },
    "auth": {
        "use_param": true,
        "param_name": "querystring_auth",
        "use_cookie": false,
        "cookie_name": "",
        "auth_header_name": "Authorization"
    },
    "use_basic_auth": false,
    "enable_jwt": false,
    "use_standard_auth": true,
    "enable_coprocess_auth": false,
    "jwt_signing_method": "",
    "jwt_source": "",
    "jwt_identity_base_field": "",
    "jwt_client_base_field": "",
    "jwt_policy_field_name": "",
    "notifications": {
        "shared_secret": "",
        "oauth_on_keychange_url": ""
    },
    "enable_signature_checking": false,
    "hmac_allowed_clock_skew": -1,
    "base_identity_provided_by": "",
    "definition": {
        "location": "header",
        "key": "x-api-version"
    },
    "version_data": {
        "not_versioned": true,
        "versions": {
            "Default": {
                "name": "Default",
                "expires": "",
                "paths": {
                    "ignored": [],
                    "white_list": [],
                    "black_list": []
                },
                "use_extended_paths": true,
                "extended_paths": {},
                "global_headers": {},
                "global_headers_remove": [],
                "global_size_limit": 0,
                "override_target": ""
            }
        }
    },
    "uptime_tests": {
        "check_list": [],
        "config": {
            "expire_utime_after": 0,
            "service_discovery": {
                "use_discovery_service": false,
                "query_endpoint": "",
                "use_nested_query": false,
                "parent_data_path": "",
                "data_path": "",
                "port_data_path": "",
                "target_path": "",
                "use_target_list": false,
                "cache_timeout": 60,
                "endpoint_returns_list": false
            },
            "recheck_wait": 0
        }
    },
    "proxy": {
        "preserve_host_header": false,
        "listen_path": "/5933f523d7ca43e175098ac01222f460/",
        "target_url": "http://httpbin.org/",
        "strip_listen_path": true,
        "enable_load_balancing": false,
        "target_list": [],
        "check_host_against_uptime_tests": false,
        "service_discovery": {
            "use_discovery_service": false,
            "query_endpoint": "",
            "use_nested_query": false,
            "parent_data_path": "",
            "data_path": "hostname",
            "port_data_path": "port",
            "target_path": "/api-slug",
            "use_target_list": false,
            "cache_timeout": 60,
            "endpoint_returns_list": false
        }
    },
    "disable_rate_limit": false,
    "disable_quota": false,
    "custom_middleware": {
        "pre": [],
        "post": [],
        "post_key_auth": [],
        "auth_check": {
            "name": "",
            "path": "",
            "require_session": false
        },
        "response": [],
        "driver": "",
        "id_extractor": {
            "extract_from": "",
            "extract_with": "",
            "extractor_config": {}
        }
    },
    "custom_middleware_bundle": "",
    "cache_options": {
        "cache_timeout": 60,
        "enable_cache": true,
        "cache_all_safe_requests": false,
        "cache_response_codes": [],
        "enable_upstream_cache_control": false
    },
    "session_lifetime": 0,
    "active": true,
    "auth_provider": {
        "name": "",
        "storage_engine": "",
        "meta": {}
    },
    "session_provider": {
        "name": "",
        "storage_engine": "",
        "meta": null
    },
    "event_handlers": {
        "events": {}
    },
    "enable_batch_request_support": false,
    "enable_ip_whitelisting": false,
    "allowed_ips": [],
    "dont_set_quota_on_create": false,
    "expire_analytics_after": 0,
    "response_processors": [],
    "CORS": {
        "enable": false,
        "allowed_origins": [],
        "allowed_methods": [],
        "allowed_headers": [],
        "exposed_headers": [],
        "allow_credentials": false,
        "max_age": 24,
        "options_passthrough": false,
        "debug": false
    },
    "domain": "",
    "do_not_track": false,
    "tags": [],
    "enable_context_vars": false
}