-
Notifications
You must be signed in to change notification settings - Fork 169
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
Add support for RHSSO and OpenId Connect #283
Merged
Merged
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
0292297
Common interface for built-in and custom OAuth implementation (Keyclo…
mayorova 18239f8
Fix oauth test
mayorova df65b2b
Read keycloak config file in init phase
mayorova 6447dd6
Params checking functions for Keycloak
mayorova 63da32f
[WIP] Keycloak token authorization working
4b75007
Add new environment variables for RHSSO
b87f577
Replace access_token in credentials with app_id extracted from jwt
fee2aa2
Add some keycloak tests
c0d8f6e
Add lua-rest-jwt to rockspec
aedd556
luacheck fixes
dcd18e2
Use same request pattern oauth_authrep as authrep for consistency and…
56e692f
[WIP] Add Client Registration code as an example
42bdbe1
Clean up
214b826
Get public key from realm endpoint
7d284d6
Update README
f1bca2c
Use http_ng client instead of proxy_pass
2219904
Update/Add dependencies
88857b8
Return authorization failed on failed jwt validation
e5c9e9e
Use redis connect from threescale_utils.lua
a1d1326
[doc] Update README after review
b346109
Fixes from review
5bbdda8
Revert changes to require libraries every request
5e39edc
Fix build
f904a1d
[WIP] Test case where JWT is not verified
09305ce
Merge from master
8caf31b
Fix oauth.lua
9ab5f3c
remove format public_key test
e973277
update README
88817f4
Move credentials check back to service.lua
533ad9d
Move credentials check back to service.lua: fixes for unhappy path
7a145fd
[WIP] get service configuration
0b4eb07
extract oauth credentials checking to oauth modules
bb9f962
Refactor
c4af07e
[WIP] OIDC flow working needs tests
da0dc81
[WIP] Working Flow after rebasing master
31bcafc
Add RHSSO_INITIAL_TOKEN as a custom environment variablee
9a5537d
Use backend client
69bb575
revert changes to service.lua made in branch
f42c19b
[WIP] Changes from refactor and some tests
8b93cb4
[WIP] fixes to proxy.lua
19729ff
[WIP] proxy to call different authorize function depending on backend…
347aea4
[proxy] fix proxy
mikz 4fe0262
[keycloak] don't try to configure keycloak without config
mikz 99bd2d8
[proxy] unify sending debug headers
mikz add69ad
Merge remote-tracking branch 'origin/master' into openid-connect
mikz 1b8eec2
Fix tests
e163dad
Danger fixes
2f7df3f
fix luacheck error
mikz 50260f0
Add RHSSO_ENDPOINT to parameters list
2e3bb26
Merge branch 'openid-connect' of github.com:3scale/apicast into openi…
d66fdd6
[proxy] reduce duplication in auth functions
mikz 4c40fae
[keycloak] improve configuration loading
mikz 50d71b1
Remove noisy log entry
efe016b
Update file locations to be more consistent with APIcast naming and R…
be86559
Remove redundant log entry
3a6a7b5
Update CHANGELOG with known issues
f3ffeab
Update CHANGELOG with issue number
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env resty | ||
|
||
pcall(require, 'luarocks.loader') | ||
package.path = package.path .. ";./src/?.lua" | ||
|
||
local keycloak = require 'oauth.keycloak' | ||
local cjson = require 'cjson' | ||
|
||
local config = keycloak.load_configuration() | ||
|
||
if config then | ||
ngx.say(cjson.encode(config)) | ||
else | ||
io.stderr:write('failed to download keycloak configuration\n') | ||
os.exit(1) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
local get_token = require 'oauth.apicast_oauth.get_token' | ||
local callback = require 'oauth.apicast_oauth.authorized_callback' | ||
local authorize = require 'oauth.apicast_oauth.authorize' | ||
local setmetatable = setmetatable | ||
|
||
local _M = { | ||
_VERSION = '0.1' | ||
} | ||
|
||
local mt = { __index = _M } | ||
|
||
function _M.new(service) | ||
return setmetatable( | ||
{ | ||
authorize = authorize.call, | ||
callback = callback.call, | ||
get_token = get_token.call, | ||
service = service | ||
}, mt) | ||
end | ||
|
||
function _M.transform_credentials(_, credentials) | ||
return credentials | ||
end | ||
|
||
return _M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to give heads up to @rnc and @3scale/productization about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Creating jira for it