-
Notifications
You must be signed in to change notification settings - Fork 5
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
OIDC post endpoint #214
OIDC post endpoint #214
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,7 @@ def login username, password, account: Conjur.configuration.account | |
# @param [Hash] params Additional params to send to authenticator | ||
# @return [String] A JSON formatted authentication token. | ||
def authenticator_authenticate authenticator, service_id, account: Conjur.configuration.account, options: {} | ||
JSON.parse authenticator_authenticate_get authenticator, service_id, account: account, options: options | ||
JSON.parse authenticator_authenticate_post authenticator, service_id, account: account, options: options | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the default behavior of If yes - should the GET routing be removed entirely? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, probably. Optimally, we would use the endpoint that is credential-agnostic for code and refresh token exchanges. Through our progress so far on the refresh token feature branch, we've maintained the GET behavior for backwards-compatibility. Maybe we should consider maintaining it here, too, until we officially remove it. |
||
end | ||
|
||
# Authenticates using a third party authenticator like authn-oidc via GET request. | ||
|
@@ -78,7 +78,23 @@ def authenticator_authenticate_get authenticator, service_id, account: Conjur.co | |
if Conjur.log | ||
Conjur.log << "Authenticating to account #{account} using #{authenticator}/#{service_id}\n" | ||
end | ||
url_for(:authenticator_authenticate, account, service_id, authenticator, options).get | ||
url_for(:authenticator_authenticate_get, account, service_id, authenticator, options).get | ||
end | ||
|
||
# Authenticates using a third party authenticator like authn-oidc via POST request. | ||
# It will return an response object containing access/refresh token data. | ||
# | ||
# @param [String] authenticator | ||
# @param [String] service_id | ||
# @param [String] account The organization account. | ||
# @param [Hash] params Additional params to send to authenticator | ||
# @return [RestClient::Response] Response object | ||
def authenticator_authenticate_post authenticator, service_id, account: Conjur.configuration.account, options: {} | ||
if Conjur.log | ||
Conjur.log << "Authenticating to account #{account} using #{authenticator}/#{service_id}\n" | ||
end | ||
encoded_params = URI.encode_www_form(options) | ||
url_for(:authenticator_authenticate_post, account, service_id, authenticator).post(encoded_params, content_type: 'application/www-url-form-encoded') | ||
end | ||
|
||
# Exchanges Conjur the API key (refresh token) for an access token. The access token can | ||
|
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.
Two scenarios relying on the updated Conjur OIDC API currently fail in CI since the functionality has yet to be merged. The tests pass when run locally against a Conjur build containing those updates.