I am integrating my custom application with crowd but i don't understant why the method getUser don't give me answer.
It's so strange because i can get the user token with the CrowdHttpAuthenticator and print but after execute the method getUser don't print me anything .
My Code:
crowdClient = new com.atlassian.crowd.integration.rest.service.factory.RestCrowdClientFactory().newInstance(clientProperties); System.out.println("crowdClient -> " + crowdClient); crowdHttpAuthenticator = new CrowdHttpAuthenticatorImpl(crowdClient, clientProperties, CrowdHttpTokenHelperImpl.getInstance( CrowdHttpValidationFactorExtractorImpl.getInstance())); System.out.println("crowdHttpAuthenticator -> " + crowdHttpAuthenticator); String token2 = crowdHttpAuthenticator.getToken(requestCrowd); System.out.println("crowdHttpAuthenticator token2: -> " + token2); boolean isAuthenticated = crowdHttpAuthenticator.isAuthenticated(requestCrowd, responseCrowd); System.out.println("crowdHttpAuthenticator isAuthenticated: -> " + isAuthenticated); User user = crowdHttpAuthenticator.getUser(requestCrowd); System.out.println("crowdHttpAuthenticator:::" + user.getExternalId());
Console output:
crowdClient -> com.atlassian.crowd.integration.rest.service.RestCrowdClient@aed92a1 crowdHttpAuthenticator -> com.atlassian.crowd.integration.http.CrowdHttpAuthenticatorImpl@aee0dd4 crowdHttpAuthenticator token2: -> kf4eSUUCRENSypA4xpIP5w00 crowdHttpAuthenticator isAuthenticated: -> false
The code never do System.out.println("crowdHttpAuthenticator:::" + user.getExternalId());
and dont print any error trace.
Please give me some ideas.
Community moderators have prevented the ability to post new answers.
It sounds like the expression crowdHttpAuthenticator.getUser(requestCrowd) is throwing an exception and getting caught in a catch block up the stack. Try explicitly wrapping it in a try catch block:
try { User user = crowdHttpAuthenticator.getUser(requestCrowd); System.out.println("crowdHttpAuthenticator:::" + user.getExternalId()); } catch (Throwable t) { t.printStackTrace(); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.