I am hitting the JIRA api authentication url from https://developer.atlassian.com/jiradev/api-reference/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-basic-authentication.
When I enter the right username and password, it returns the token in response but when I enter the wrong password and username then it is returning the same token. I cannot resolve this problem please can someone help me.
I am using this code.
NSURL * urlToHit = [NSURL URLWithString:loginUrl];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:urlToHit cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:300];
NSString *postLength = [NSString stringWithFormat:@"%lu", (unsigned long)[data length]];
[request setHTTPMethod:[customizedHeaders valueForKey:HTTP_HEADER_METHOD_TYPE]?:@"POST"];
// NSLog(@"%@",[request setHTTPMethod])
[request setValue: postLength forHTTPHeaderField:HTTP_HEADER_CONTENT_LENGTH];
[request setValue:[customizedHeaders valueForKey:HTTP_HEADER_ACCEPT]?:@"*/*" forHTTPHeaderField:HTTP_HEADER_ACCEPT];
[request setValue:[customizedHeaders valueForKey:HTTP_HEADER_CONTENT_TYPE]?:@"application/json" forHTTPHeaderField:HTTP_HEADER_CONTENT_TYPE];
[request setHTTPBody:data];
NSError *error = nil;
NSHTTPURLResponse *response = nil;
NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSLog(@"~~~~~ Status code: %ld", (long)[response statusCode]);