Comments (5)
Ok I got it, maybe you can add an example:
block, _ := pem.Decode([]byte(keyRSAPrivate))
privateKey, err := x509.ParsePKCS1PrivateKey(block.Bytes)
if err != nil {
...
}
And then for Jira use the following configuration
c := oauth.NewRSAConsumer(
keyConsumer,
privateKey,
oauth.ServiceProvider{
RequestTokenUrl: jiraURL + "/plugins/servlet/oauth/request-token",
AuthorizeTokenUrl: jiraURL + "/plugins/servlet/oauth/authorize",
AccessTokenUrl: jiraURL + "/plugins/servlet/oauth/access-token",
HttpMethod: "POST",
},
)
Since we use a self signed certificate I also just ignore the verification:
c.HttpClient = &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
}
from oauth.
Hey cool, thanks for figuring this out. I actually haven't used the RSASHA1 signatures before (someone else added them) so this is neat to see.
I'd love to use this in an example ... only, after a brief search, I couldn't seem to find many (or any really) OAuth service providers that use RSASHA1 signatures. Google has a few that seem to work this way, but they claim to be shutting down all the OAuth 1.0 endpoints soon, so such an example would quickly become obsolete.
Do you have an example site in mind that we could use as the basis for an example?
from oauth.
I think that an example for an imaginable Jira instance is just fine since all Atlassian products only support Oauth 1. Here is some documentation on this https://bitbucket.org/atlassian_tutorial/atlassian-oauth-examples I think it is OK to use the code from my comment before and let people just set the jiraURL variable to the URL of their instance e.g. "https://jira.atlassian.com" for the official public Atlassian Jira instance. You can basically pick any Atlassian service or any project which is using something from Atlassian but the problem is that you need access to the administration to add an "application link" to register the public key.
from oauth.
Ok, I created a jira example:
https://github.com/mrjones/oauth/blob/master/examples/jira/jira.go
I couldn't easily find a Jira project where I could be an administrator to add the Application Links you mentioned, so for now this will just have to be un-tested. Which means it's almost certainly broken in some way :)
If you have a Jira instance that you can access, feel free to test it out, and let me know if it works. If it's broken, I can try to fix it or I'd be happy to accept a pull request.
Thanks again for your help!
- Matt
from oauth.
I fixed the REST API URL with #28 but other than that it works fine with our Jira instance.
from oauth.
Related Issues (20)
- Add more structure to errors HOT 3
- Using "UnixNano" as a random seed HOT 1
- Seems Twitter auth doesn't work without oob but with callback url HOT 2
- broken request if parameter contains ";" HOT 4
- Verifying requests HOT 1
- Error reading privateKey HOT 2
- Would like to patch so that Oauth works with Yahoo. Preferred Way? HOT 8
- Space not properly escaped HOT 1
- Twitter example doesn't work HOT 1
- No license HOT 1
- Not working for Twitter
- Does this library work with one legged authorization? HOT 7
- Not able to make OAUTH Post call HOT 2
- The logic behind preventing multiple form parameters with same name. HOT 5
- HTTP/S Proxy Support HOT 2
- Consider merging with Gomniauth
- Renew access token HOT 1
- Consider rename to `LICENSE.txt`
- Return HTTP response to clients even on non 2XX responses. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oauth.