com.okta.authn.sdk.client.AuthenticationClient Java Examples

The following examples show how to use com.okta.authn.sdk.client.AuthenticationClient. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExampleApplication.java    From okta-auth-java with Apache License 2.0 6 votes vote down vote up
private void configureJersey(JerseyEnvironment jersey) {

        // Load any resource in the resources package
        String baseResourcePackage = getClass().getPackage().getName() + ".resources";
        jersey.packages(baseResourcePackage);

        AuthenticationClient client = AuthenticationClients.builder()
                                                           .build();

        // use @Inject to bind the DAOs
        jersey.register(new AbstractBinder() {
            @Override
            protected void configure() {
                bind(new DefaultStormtrooperDao()).to(StormtrooperDao.class);
                bind(new DefaultTieCraftDao()).to(TieCraftDao.class);
                bind(client).to(AuthenticationClient.class);
            }
        });
    }
 
Example #2
Source File: DefaultAuthenticationClientBuilder.java    From okta-auth-java with Apache License 2.0 5 votes vote down vote up
@Override
public AuthenticationClient build() {

    if (this.clientConfig.getBaseUrlResolver() == null) {
        Assert.notNull(this.clientConfig.getBaseUrl(), "Okta org url must not be null.");
        this.clientConfig.setBaseUrlResolver(new DefaultBaseUrlResolver(this.clientConfig.getBaseUrl()));
    }

    this.clientConfig.setClientCredentialsResolver(new DisabledClientCredentialsResolver());
    return new DefaultAuthenticationClient(this.clientConfig);
}
 
Example #3
Source File: OktaAuthConnector.java    From cerberus with Apache License 2.0 5 votes vote down vote up
@Autowired
public OktaAuthConnector(
    final OktaApiClientHelper oktaApiClientHelper,
    AuthenticationClient oktaAuthenticationClient) {

  this.oktaApiClientHelper = oktaApiClientHelper;
  this.oktaAuthenticationClient = oktaAuthenticationClient;
}
 
Example #4
Source File: OktaConfiguration.java    From cerberus with Apache License 2.0 5 votes vote down vote up
@Bean
AuthenticationClient authenticationClient(
    OktaConfigurationProperties oktaConfigurationProperties) {
  System.setProperty("okta.client.token", oktaConfigurationProperties.getApiKey());
  return AuthenticationClients.builder()
      .setOrgUrl(oktaConfigurationProperties.getBaseUrl())
      .build();
}
 
Example #5
Source File: ReadmeSnippets.java    From okta-auth-java with Apache License 2.0 4 votes vote down vote up
private void createClient() throws AuthenticationException {
    AuthenticationClient client = AuthenticationClients.builder()
        .setOrgUrl("https://{yourOktaDomain}")
        .build();
}
 
Example #6
Source File: LoginResource.java    From okta-auth-java with Apache License 2.0 4 votes vote down vote up
@Inject
public LoginResource(AuthenticationClient authenticationClient) {
    this.authenticationClient = authenticationClient;
}
 
Example #7
Source File: ContainerActivity.java    From samples-android with Apache License 2.0 4 votes vote down vote up
@Override
public AuthenticationClient provideAuthenticationClient() {
    return authenticationClient;
}
 
Example #8
Source File: InitialLoginStateHandler.java    From cerberus with Apache License 2.0 4 votes vote down vote up
public InitialLoginStateHandler(
    AuthenticationClient client, CompletableFuture<AuthResponse> authenticationResponseFuture) {
  super(client, authenticationResponseFuture);
}
 
Example #9
Source File: AbstractOktaStateHandler.java    From cerberus with Apache License 2.0 4 votes vote down vote up
public AbstractOktaStateHandler(
    AuthenticationClient client, CompletableFuture<AuthResponse> authenticationResponseFuture) {
  this.client = client;
  this.authenticationResponseFuture = authenticationResponseFuture;
}
 
Example #10
Source File: MfaStateHandler.java    From cerberus with Apache License 2.0 4 votes vote down vote up
public MfaStateHandler(
    AuthenticationClient client, CompletableFuture<AuthResponse> authenticationResponseFuture) {
  super(client, authenticationResponseFuture);
}
 
Example #11
Source File: IOktaAuthenticationClientProvider.java    From samples-android with Apache License 2.0 votes vote down vote up
AuthenticationClient provideAuthenticationClient();