All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clouway.oauth2.exampleapp.security.SecurityModule Maven / Gradle / Ivy

The newest version!
package com.clouway.oauth2.exampleapp.security;

import com.google.common.collect.Sets;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Singleton;

public class SecurityModule extends AbstractModule {

  private String url = "";
  private String loginPageUrl = "";

  public SecurityModule(String url) {
    this.url = url;
  }

  public SecurityModule(String url, String loginPageUrl) {
    this.url = url;
    this.loginPageUrl = loginPageUrl;
  }

  protected void configure() {

  }

  @Provides
  @Singleton
  public SecuredResources provideSecuredResources() {
    return new SecuredResources(Sets.newHashSet("/oauth2/auth"));
  }

  @Provides
  @UriPath
  public String uriPath() {
    return url;
  }

  @Provides
  @LoginPageUrl
  public String loginPageUrl() {
    return loginPageUrl;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy