Access to API Disallowed

Hi There,

I have setup tyk in a production environment. Recently i have been getting issues with the api key expiring even though it is set not to expire. Just clicking update on the correspondent api seems to resolve the issue and the key works again. There is no rate limit or quota set. Can anybody help me with a more permanent solution.

Thanks,

Athul Krishna

This is a bit odd, are you running latest?

Yeah even after updating to the latest version the issue persists.

How many gateways are you running?
Are you using policies?
How are the policies and apis configured (assuming dashboard)
Are the servers sharing the same redis DB?

A single gateway with policies.
The api is configured with both rate limiting and quota disabled. Policy is setup so that only access to this particular api is granted and key is set not to expire. HMAC is also enabled.

Hi
Did you see any error in the logs when the key is expired? and also after you update the api?
If not - can you possible export your api and policy and upload it?

1 Like

No apparent errors in log. Here are the policy and api definitions.
API DEFINITION
{ "id": "592422beb4e89e1140069b89", "name": "FacebookVideos API", "slug": "facebookvideos-api", "api_id": "ceaf346d38c44c41464789afa558fac5", "org_id": "59242154b4e89e0fd5992133", "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": false, "param_name": "", "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": { "track_endpoints": [ { "path": "/videos", "method": "GET" } ] }, "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": "/videos", "target_url": "###########", "strip_listen_path": false, "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": true, "disable_quota": true, "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": false, "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": { "AuthFailure": [ { "handler_name": "eh_web_hook_handler", "handler_meta": { "_id": "597b0cb0b4e89e75d88fcee9", "event_timeout": 60, "header_map": {}, "method": "POST", "name": "Slack", "org_id": "59242154b4e89e0fd5992133", "target_path": "https://hooks.slack.com/services/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", "template_path": "" } } ], "KeyExpired": [ { "handler_name": "eh_web_hook_handler", "handler_meta": { "_id": "597b0cb0b4e89e75d88fcee9", "event_timeout": 60, "header_map": {}, "method": "POST", "name": "Slack", "org_id": "59242154b4e89e0fd5992133", "target_path": "https://hooks.slack.com/services/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", "template_path": "" } } ] } }, "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": "get.apeei.com", "do_not_track": false, "tags": [], "enable_context_vars": false, "config_data": {} }

POLICY DEFINITION
{ "_id": "59250cd3b4e89e511abb05c3", "access_rights": { "ceaf346d38c44c41464789afa558fac5": { "allowed_urls": [], "apiid": "ceaf346d38c44c41464789afa558fac5", "apiname": "FacebookVideos API", "versions": [ "Default" ] } }, "active": true, "date_created": "0001-01-01T00:00:00Z", "hmac_enabled": true, "is_inactive": false, "key_expires_in": 0, "last_updated": "1503644736", "name": "Facebook Videos", "org_id": "59242154b4e89e0fd5992133", "partitions": { "acl": false, "quota": false, "rate_limit": false }, "per": 60, "quota_max": -1, "quota_renewal_rate": 30240000, "rate": 1000000, "tags": [ "Facebook Videos Count" ] }

Can you share your gateway log please when this error occurs?