Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,447
Community Members
 
Community Events
176
Community Groups

How to login without password (token-based) into confluence 6.8 from crowd SSO ?

Hi there,

I want to login into confluence 6.8 from my web application without password 

actually, I need to login into confluence by username only 

I can get the user token from rest api but when i put the user token in cookie and return back to confluence , nothing happened

 

I have integrated confluence with Crowd and I have activated the SSO but I don't know how can I use crown in my web application ??

Is there any easy solution to login ??? 

 

My  email address : hamedhatami2012@gmail.com

 

Regards,

Hamed Hatami

4 answers

This is a snipet of code to getting token from crowd and then I should goto confluence or jira from inside of my web application that is based on Java EE 7 :  

 

public static String getToken(String propertyName, String username, String password) throws Exception {
String token = "";
Properties crowd_props = new Properties();
crowd_props.load(CrowdClientUtil.class.getClassLoader().getResourceAsStream("/" + propertyName.trim()));
ClientProperties clientProperties = ClientPropertiesImpl.newInstanceFromProperties(crowd_props);
CrowdClient crowdClient = new com.atlassian.crowd.integration.rest.service.factory.RestCrowdClientFactory().newInstance(clientProperties);
/* CrowdHttpAuthenticator crowdHttpAuthenticator = new CrowdHttpAuthenticatorImpl(crowdClient,
clientProperties,
CrowdHttpTokenHelperImpl.getInstance(
CrowdHttpValidationFactorExtractorImpl.getInstance()));*/
UserAuthenticationContext userAuthenticationContext = new UserAuthenticationContext();
userAuthenticationContext.setName(username);
userAuthenticationContext.setCredential(new PasswordCredential(password, false));
ValidationFactor[] factors = new ValidationFactor[]{
new ValidationFactor("remote_address", "127.0.0.1"),
new ValidationFactor("X-Forwarded-For", clientProperties.getApplicationAuthenticationURL())
};

userAuthenticationContext.setValidationFactors(factors);
userAuthenticationContext.setApplication(clientProperties.getApplicationName());

token = crowdClient.authenticateSSOUserWithoutValidatingPassword(userAuthenticationContext);

return token;
}

 

 

Actually I also have crowd.property file in my web application and client crowd jar file to access

I have changed the "seraph-config.xml" file in (confluence and jira) side to use sso authenticator instead of simple authenticator and then I have created many users and groups with specific access rights to a specific directory in crowd side and import the users and groups from (confluence and jira) into crowd and in (confluence and jira), I have set the correct groups and users into specific user directory and  WhiteList has been created too although I have created application link to connect all of them together so I need connect as sso like into crowd and then go to confluence or jira without login (token-based) easily and actually do everything from my web application programmatically and I should have access to crowd from my web application by client api or rest invocation and then with some doing task that you should specify for me , i should go directly into confluence or jira,

I have read the documents of crowd and confluence / jira and there is not step by step and clear document about how to exactly configured or there is not an clear example on github ....

 

I have got stucked in this problem and   I need to give me a hand ASAP.

 

Thanks in advance

As a matter of fact, my web application is a  client of crowd and I can get token from crowd but I need an exact example of parameter should set into confluence url to authenticated correctly, and directly goes to confluence in my web application response

Actually, I have integrated Crowd's (users and groups) with Confluence and Jira but one of my important requirements was to use crowd as SSO center and my web application should redirect to confluence/jira pages without login ???

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events