-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth plugin error oauth2/access.lua:722: [off] cannot create 'oauth2_tokens' entities when not using a database, #14295 #14297
Comments
HI @masthanoli! http PUT :8001/consumers/495063e6-5e46-4734-b384-278f7069094d username="bob" custom_id="bob123"
echo '''{
"tags": null,
"client_type": "confidential",
"created_at": 123,
"hash_secret": false,
"client_secret": "xxxxxxxxxxRZYqAxxxxxxx",
"name": "testaouth",
"redirect_uris": null,
"client_id": "xxxxxxxxxMrIpxxxxxxxxx",
"consumer": {
"id": "495063e6-5e46-4734-b384-278f7069094d"
}
}
''' | http :8001/oauth2 Could you share a few more insights on how to reproduce this issue? What commands have you run? How did you set up your kong instance? Could you verify if the issue persists on the latest kong version as well? |
Hi, Thanks for your reply, but we can able to replicate the issue, very simple upstream used https://restful-api.dev/ and still facing the issue as:
service {
"client_certificate": null,
"name": "test_restful",
"connect_timeout": 60000,
"read_timeout": 60000,
"id": "2f127535-1c9a-4295-acc5-7b540345836a",
"path": null,
"host": "api.restful-api.dev",
"ca_certificates": null,
"created_at": 1740386045,
"enabled": true,
"retries": 5,
"tags": [],
"updated_at": 1740386045,
"tls_verify": null,
"protocol": "https",
"tls_verify_depth": null,
"port": 443,
"write_timeout": 60000,
"extras": {
"createdUser": null,
"updatedUser": null,
"kong_node_id": "66cc6b3a75cf2a0007e7f8b8",
"service_id": "2f127535-1c9a-4295-acc5-7b540345836a",
"createdAt": "2025-02-24T08:34:05.015Z",
"updatedAt": "2025-02-24T08:34:05.015Z",
"id": "67bc2efd284608000738e1d3"
}
} service - routes {
"request_buffering": true,
"response_buffering": true,
"name": null,
"https_redirect_status_code": 426,
"id": "492e3a7b-8350-4b51-8faf-17d331d84908",
"created_at": 1740386085,
"path_handling": "v1",
"tags": null,
"regex_priority": 0,
"headers": null,
"methods": null,
"hosts": null,
"preserve_host": false,
"sources": null,
"strip_path": true,
"updated_at": 1740386085,
"service": {
"id": "2f127535-1c9a-4295-acc5-7b540345836a"
},
"destinations": null,
"protocols": [
"http",
"https"
],
"snis": null,
"paths": [
"/testservice"
]
} service - plugins - oauth2 {
"enabled": true,
"config": {
"enable_password_grant": false,
"enable_client_credentials": true,
"enable_implicit_grant": false,
"enable_authorization_code": false,
"persistent_refresh_token": false,
"scopes": [
"read"
],
"refresh_token_ttl": 1209600,
"token_expiration": 7200,
"provision_key": "u5LxihHSwsTI74HgTHQ1IztGOVQZOwdO",
"mandatory_scope": true,
"accept_http_if_already_terminated": false,
"auth_header_name": "authorization",
"pkce": "lax",
"reuse_refresh_token": false,
"hide_credentials": false,
"anonymous": null,
"global_credentials": false
},
"route": null,
"id": "e6e9e3ae-39ad-4d68-bb85-f5d8866e104a",
"name": "oauth2",
"created_at": 1740386149,
"consumer": null,
"updated_at": 1740386149,
"tags": null,
"consumer_group": null,
"service": {
"id": "2f127535-1c9a-4295-acc5-7b540345836a"
},
"instance_name": null,
"protocols": [
"grpc",
"grpcs",
"http",
"https",
"ws",
"wss"
],
"ordering": null
} consumer {
"created_at": 1740386202,
"username_lower": "testconsumer",
"custom_id": null,
"updated_at": 1740386202,
"id": "90bb298e-d89c-4990-9462-b4b27ecadcb2",
"username": "testconsumer",
"type": 0,
"tags": []
} consumer - credentials - oauth2 {
"name": "testoauth",
"client_id": "VyfibWb4ZbfKYkjKnWHHBznoPiBeARE0",
"client_type": "confidential",
"created_at": 1740386227,
"tags": null,
"client_secret": "GIwObLaSYpEg78TbFpsG9YNGdGTsOc5l",
"redirect_uris": null,
"id": "90ca7aad-f1c8-4e9e-8c48-d91106f4985e",
"hash_secret": false,
"consumer": {
"id": "90bb298e-d89c-4990-9462-b4b27ecadcb2"
}
} |
@nowNick , please provide your feedback. |
Is there an existing issue for this?
Kong version (
$ kong version
)Kong 3.71.
Current Behavior
Hi,
Im getting error as
[error] 2406#0: *705813 [kong] init.lua:426 [oauth2] ./oauth2/access.lua:722: [off] cannot create 'oauth2_tokens' entities when not using a database, client: x.x.x.x, server: kong, request: "POST /service/oauth2/token HTTP/1.1", host: "mydomain.com", request_id: "20bcab79f3ef66426302b90b1ea23421"
But it is not DB less, already DBMS postgres added
KONG Version: 3.7.1.2
LUA Version : LuaJIT 2.1.0-20231117
consumer - plugin (oauth2)
The text was updated successfully, but these errors were encountered: