
com.stormpath.sdk.authc.UsernamePasswordRequests Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stormpath-sdk-api Show documentation
Show all versions of stormpath-sdk-api Show documentation
The Stormpath Java SDK API .jar provides a Java API that your code can use to make calls to the Stormpath
API. This .jar is the only compile-time dependency within the Stormpath SDK project that your code should
depend on. Implementations of this API (implementation .jars) should be runtime dependencies only.
The newest version!
package com.stormpath.sdk.authc;
import com.stormpath.sdk.lang.Classes;
/**
* Static utility/helper methods for working with username/password-based {@link AuthenticationRequest}s. Most methods
* are factory methods used for forming
* Application-specific fluent DSL queries. For example:
*
* AuthenticationRequest request = UsernamePasswordRequests.builder()
* .setUsernameOrEmail(username)
* .setPassword(submittedRawPlaintextPassword)
* .build();
* Account authenticated = application.authenticateAccount(request).getAccount();
*
*
* @see UsernamePasswordRequestBuilder
* @since 1.0.RC9
*/
public class UsernamePasswordRequests {
/**
* Returns a new {@link UsernamePasswordRequestBuilder} instance, used to construct username/password-based {@link AuthenticationRequest}s.
*
* @return a new {@link UsernamePasswordRequestBuilder} instance, used to construct username/password-based {@link AuthenticationRequest}s.
* @since 1.0.RC5
*/
public static UsernamePasswordRequestBuilder builder() {
return (UsernamePasswordRequestBuilder) Classes.newInstance("com.stormpath.sdk.impl.authc.DefaultUsernamePasswordRequestBuilder");
}
/**
* Returns a new {@link BasicAuthenticationOptions} instance, that may be used to customize the {@link com.stormpath.sdk.authc.AuthenticationResult
* AuthenticationResult} resource that will be obtained after a successful authentication. For example:
*
* AuthenticationRequest request = UsernamePasswordRequests.builder()
* .setUsernameOrEmail(username)
* .setPassword(submittedRawPlaintextPassword)
* .withResponseOptions(UsernamePasswordRequests.options().withAccount())
* .build();
* Account authenticated = application.authenticateAccount(request).getAccount();
*
*
* @return a new {@link BasicAuthenticationOptions} instance, that may be used to customize the {@link com.stormpath.sdk.authc.AuthenticationResult
* AuthenticationResult} resource that will be obtained after a successful authentication.
* @see com.stormpath.sdk.authc.UsernamePasswordRequestBuilder#withResponseOptions(BasicAuthenticationOptions)
* @since 1.0.RC5
*/
public static BasicAuthenticationOptions options() {
return (BasicAuthenticationOptions) Classes.newInstance("com.stormpath.sdk.impl.authc.DefaultBasicAuthenticationOptions");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy