-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Can't log in to self-hosted Jira with API Key #14
Comments
Can you try once with username and password combination instead to figure out if Basic authentication with password works? @danielkza |
@amritghimire I don't have a password as login is performed through SSO only :( |
Please have a look at https://wiki.resolution.de/doc/saml-sso/latest/all/knowledgebase-articles/technical/using-the-atlassian-product-s-rest-api-with-saml-sso-enabled Option 3 if it helps. @danielkza |
After quite a while, I figured out what the issue is. My company's Jira Instance requires the username to be used for authorization, as determined by the Okta SSO. But Jira-terminal asks for the email, and tries to use that to authenticate. If I simply pass my usernames as the email, the authentication will be successful, but the test query attempting to find an user with that email will fail. I think this can be solved by checking for the presence of an |
Thank you @danielkza . Will look into it. |
any progress on this issue? |
The new version has been fixed with better error reporting. Can you please drop your error stack in the thread? |
|
pub fn get_username(configuration: &json::JsonValue) -> String {
let url = format!(
"user/search?query={}",
configuration["email"].as_str().unwrap().to_string()
);
let api_request = api::request::ApiRequest {
url,
username: configuration["email"].as_str().unwrap().to_string(),
password: configuration["token"].as_str().unwrap().to_string(),
json: json::object! {},
namespace: configuration["namespace"].as_str().unwrap().to_string(),
version: 3,
};
let response = api::get(api_request).unwrap();
let account_id = String::from(response[0]["accountId"].as_str().unwrap());
account_id
} Is that url is correct for jira server instance? The server said it's a dead link |
Yes, we are querying the search endpoint to fetch the accountId that is used lately due to recent change in GDPR. Seems like the search endpoint is disabled in Self hosted JIRA Instance. @songtianyi |
This works fine in my terminal. But i see the source code is https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html |
Thanks, Will look into supporting bearer auth as well. @songtianyi |
I generated an API key to connect to my company's Jira instance, but it does not seem to work. Set up fails with:
I know this is not a lot of useful information, but I don't know exactly what to do do debug it.
I surmise this might be related to the Jira instance being set up with Okta SSO. Any guesses?
edit: seems the instance is using the
de.resolution.apitokenauth
plugin for API token authentication, if that could be the cause..The text was updated successfully, but these errors were encountered: