Skip to content

Commit

Permalink
Update Okta headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Quaresma committed Aug 31, 2018
1 parent ca01c2d commit d3a1fff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion kong/plugins/okta-auth/access.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions spec/unit/access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d3a1fff

Please sign in to comment.