This is an app example how to login to a Ruby on Rails app trough Jira using OAuth.
About Jira and OAuth Application Links you can read more at developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+OAuth+authentication.
This example is using the gem sorcery with JIRA to do the login (github.com/camilasan/sorcery/)
You can generate the consumer key and the public key running these commands (in the repo folder):
-
rake jira:generate_consumer_key # Generate a consumer key for your application
-
rake jira:generate_public_cert # Run the system call to generate a RSA public certificate
With these keys you can create the appliation link your JIRA instance and update the config/initializers/sorcery.rb file:
config.jira.key = "YourC0nsum3rkeyHere010101" config.jira.secret = "JiraLoginExample" config.jira.site = "http://localhost:2990/jira/plugins/servlet/oauth" config.jira.signature_method = "RSA-SHA1" config.jira.private_key_file = "rsakey.pem" config.jira.callback_url = "http://localhost:3000/sessions/show/"
More info: