Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Account with MCF password is not properly created via Directory #1295

Closed
mrioan opened this issue Feb 6, 2017 · 0 comments
Closed

Account with MCF password is not properly created via Directory #1295

mrioan opened this issue Feb 6, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@mrioan
Copy link
Contributor

mrioan commented Feb 6, 2017

An account with MCF password created via Application works fine, while it fails for Directory.

You can use this test to validate that:

Application application = client.getResource(applicationUrl, Application.class);
Directory directory = client.getResource(dirUrl, Directory.class);

Account account = client.instantiate(Account.class);
String username = "deleteme" + UUID.randomUUID();
account.setEmail(username + "@mailinator.com")
                .setUsername(username)
                .setGivenName(username)
                .setSurname(username)
               .setPassword("$2a$12$ctIUO.W0pzIRTKHqK5Fl4uDWBB0ysSE3XJi9jcNAtRvdhUVAHnp2e"); //the password is Mario123 (created with https://www.dailycred.com/article/bcrypt-calculator)

// creation via application works fine, uncomment the following line and comment the directory one
// account = application.createAccount(Accounts.newCreateRequestFor(account).setPasswordFormat(PasswordFormat.MCF).build());

//creation via directory does not work properly
account = directory.createAccount(Accounts.newCreateRequestFor(account).setPasswordFormat(PasswordFormat.MCF).build());

AuthenticationResult authenticationResult = application.authenticateAccount(
                UsernamePasswordRequests.builder()
                        .setUsernameOrEmail(username)
                        .setPassword("Mario123")
                        .withResponseOptions(UsernamePasswordRequests.options().withAccount())
                        .build());

Assert.assertEquals(authenticationResult.getAccount().getUsername(), username);

See support ticket 11330

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants