-
Notifications
You must be signed in to change notification settings - Fork 58
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
To support token based authentication #53
Merged
liderman
merged 19 commits into
citilinkru:master
from
sgadisetti:feature/oauth2_support
Aug 4, 2023
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
96470a1
changes to camunda client to use bearer token
465608a
README changes
5f3503a
go sum changes
27d6941
To support Token based authentication
f19ddc9
To support token based authentication
sashankgadisetti 7b16633
token changes
41bfb20
token changes
025c7d1
Delete README.md
sgadisetti 00a3155
Delete go.sum
sgadisetti 8237278
changes to camunda client to use bearer token
1096d56
README changes
30d6de9
go sum changes
1967ebc
token changes
adff9d3
token changes
eaae78d
Merge branch 'feature/oauth2_support' of https://github.com/sgadisett…
7ae0361
token changes
8acb481
token changes
185187e
conflicts resolved
c631bd7
restoring deleted files
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
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.
It seems to me that it is not worth adding a new dependency just to put down one HTTP header. This can be done like 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.
Hi @liderman Thanks for quick review!
As Oauth2 provides different popular flows like Authorization Code Flow, Client Credentials Flow.. and also supports refresh token, I thought it would be good to use it and client applications can pass the token that it gets from authorization server as is without having any conversion in the client code.
Token object as follows..
type Token struct {
// AccessToken is the token that authorizes and authenticates
// the requests.
AccessToken string
json:"access_token"
}
Please let me know your thoughts. I am flexible either way!
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.
@sgadisetti
You are using the "SetAuthHeader" method, which only sets the "Authorization" HTTP header:
https://cs.opensource.google/go/x/oauth2/+/refs/tags/v0.9.0:token.go;l=84
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.
@liderman Please check the latest changes and see if they make sense!