Hi,
I try to create user using Java and REST API, but when i do it i have a 401 error. It is a user is not authenticated error. How i can authenticat with java and REST?
Maybe somebody have some code exfmple?
With Jersey Client
ClientResponse response;
String auth = new String(Base64.encode("username" + ":" + "password"));
final String headerAuthorization = "Authorization";
final String headerAuthorizationValue = "Basic " + auth;
final String headerType = "application/json";
Client client = Client.create();
WebResource webResource = client.resource("url");
response = webResource.header(headerAuthorization, headerAuthorizationValue).type(headerType).accept(headerType).get(ClientResponse.class);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what is the package of Base64
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It doesn't work for me :(
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I used this URL:
WebResource webResource = client.resource("https://deljira");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kanishk.Kejriwal you can use the Base64 class from these locations:
// From the Jersey Client dependency
import com.sun.jersey.core.util.Base64;
String auth = new String(Base64.encode("username" + ":" + "password"));
// From Java
import java.util.Base64;
import java.nio.charset.StandardCharsets;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How to do it with OAUTH2.0
as you are using basic auth here for authentication
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am asking for JIRA software
the way to do OAUTH2.0 authentication call is here: https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/
from this document I got to know how to authenticate using OAUTH2.0 But the thing is I have to put the Authorization code URI in Browser to get the auth code you can refer to this
video: https://www.youtube.com/watch?v=ayiGEctaky0&t=4s
timestamp: 2:48 onwards
then after that I can make the access token request with the help of that AUTH code
but what I want to know is , how can I do this AUTHORIZATION CALL thing in POSTMAN
How can i do the Authorization call inside postman?????
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.