diff --git a/kong/plugins/okta-auth/access.lua b/kong/plugins/okta-auth/access.lua index e63b37b..e2df140 100644 --- a/kong/plugins/okta-auth/access.lua +++ b/kong/plugins/okta-auth/access.lua @@ -19,7 +19,7 @@ end local function extract_data(token_data) local extracted_data = {} - local required_data = {"username", "group", "scope"} + local required_data = {"cid", "sub", "scp", "groups"} for _, field in pairs(required_data) do if token_data[field] then extracted_data[field] = token_data[field] end diff --git a/spec/unit/access_spec.lua b/spec/unit/access_spec.lua index 1c9e1dc..8c0888c 100644 --- a/spec/unit/access_spec.lua +++ b/spec/unit/access_spec.lua @@ -73,14 +73,16 @@ describe("Access", function() it("return true and introspect response if token is valid", function() introspect_response = {} introspect_response['exp'] = 1507397726 - introspect_response['scope'] = 'read write' - introspect_response['username'] = 'user' - introspect_response['group'] = {'Everyone'} + introspect_response['scp'] = 'read write' + introspect_response['cid'] = 'user' + introspect_response['sub'] = 'user' + introspect_response['groups'] = {'Everyone'} expected_token_data = { - ["scope"] = "read write", - ["username"] = "user", - ["group"] = {"Everyone"} + ["scp"] = "read write", + ["cid"] = "user", + ["sub"] = "user", + ["groups"] = {"Everyone"} } stub(jwt, "validate_with_jwks").returns(introspect_response)