com.stormpath.sdk.application.Application.getName()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中com.stormpath.sdk.application.Application.getName()方法的一些代码示例,展示了Application.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.getName()方法的具体详情如下:
包路径:com.stormpath.sdk.application.Application
类名称:Application
方法名:getName

Application.getName介绍

[英]Returns the Application's name. An application's name must be unique across all other applications in the owning Tenant.
[中]返回应用程序的名称。应用程序的名称在所属租户的所有其他应用程序中必须是唯一的。

代码示例

代码示例来源:origin: stormpath/stormpath-sdk-java

@RequestMapping("/")
  public String hello(HttpServletRequest req) {
    return "Hello, " + app.getName();
  }
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Bean
public String startupMessage() {
  return "Welcome to the '" + stormpathApplication.getName() + "' application!";
}

代码示例来源:origin: stormpath/stormpath-sdk-java

public static void main(String[] args) {
  ApplicationContext ctx = SpringApplication.run(App.class, args);
  //You can interact with your application's record in Stormpath:
  Application myApp = ctx.getBean(Application.class);
  System.out.println("\n");
  System.out.println("Welcome to the '" + myApp.getName() + "' application!");
  //You can also obtain the Stormpath Client to interact with your tenant too:
  Client stormpathClient = ctx.getBean(Client.class);
  System.out.println("My tenant info: " + stormpathClient.getCurrentTenant());
  System.out.println("\n");
}

代码示例来源:origin: stormpath/stormpath-sdk-java

protected String getRealmName(HttpServletRequest request) {
  Application application = getApplication(request);
  return application.getName();
}

代码示例来源:origin: com.stormpath.spring/stormpath-spring-security-webmvc

public AuthenticationEntryPoint stormpathAuthenticationEntryPoint() {
  return new StormpathAuthenticationEntryPoint(loginUri, produces, meUri, application.getName());
}

代码示例来源:origin: com.stormpath.sdk/stormpath-sdk-servlet

protected String getRealmName(HttpServletRequest request) {
  Application application = getApplication(request);
  return application.getName();
}

代码示例来源:origin: stormpath/stormpath-sdk-java

public AuthenticationEntryPoint stormpathAuthenticationEntryPoint() {
  return new StormpathAuthenticationEntryPoint(loginUri, produces, meUri, application.getName());
}

代码示例来源:origin: stormpath/stormpath-shiro

public static void main(String[] args) {

    ApplicationContext ctx = SpringApplication.run(App.class, args);

    //You can interact with your application's record in Stormpath:
    Application myApp = ctx.getBean(Application.class);

    System.out.println("\n");
    System.out.println("Welcome to the '" + myApp.getName() + "' application!");

    //You can also obtain the Stormpath Client to interact with your tenant too:
    Client stormpathClient = ctx.getBean(Client.class);
    System.out.println("My tenant info: " + stormpathClient.getCurrentTenant());
    System.out.println("\n");

    SecurityManager securityManager = ctx.getBean(SecurityManager.class);
    System.out.println("My securityManager: " + securityManager.toString() );
    System.out.println("\n");

    System.out.println( ctx.getBean(Realm.class));

  }
}

代码示例来源:origin: net.unicon.cas/cas-addons

@Override
protected boolean authenticateUsernamePasswordInternal(final UsernamePasswordCredentials credentials) throws AuthenticationException {
  try {
    this.log.debug("Attempting to authenticate user [{}] against application [{}] in Stormpath cloud...", credentials.getUsername(), this.application.getName());
    this.authenticateAccount(credentials);
    this.log.debug("Successfully authenticated user [{}]", credentials.getUsername());
    return true;
  }
  catch (ResourceException e) {
    this.log.error(e.getMessage(), e);
    throw new BadCredentialsAuthenticationException();
  }
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Bean
public Application stormpathApplication() {
  //purposefully return the Stormpath admin console app.
  //Real apps would never do this, but this is an easy way to test that bean overrides work:
  for (Application app : client.getApplications()) {
    if (app.getName().equalsIgnoreCase("Stormpath")) { //return the admin app
      return app;
    }
  }
  throw new IllegalStateException("Stormpath application is always available in Stormpath.");
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Bean
public Application stormpathApplication() {
  //purposefully return the Stormpath admin console app.
  //Real apps would never do this, but this is an easy way to test that bean overrides work:
  for (Application app : client.getApplications()) {
    if (app.getName().equalsIgnoreCase("Stormpath")) { //return the admin app
      return app;
    }
  }
  throw new IllegalStateException("Stormpath application is always available in Stormpath.");
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Bean
public Application stormpathApplication() {
  //purposefully return the Stormpath admin console app.
  //Real apps would never do this, but this is an easy way to test that bean overrides work:
  for (Application app : client.getApplications()) {
    if (app.getName().equalsIgnoreCase("Stormpath")) { //return the admin app
      return app;
    }
  }
  throw new IllegalStateException("Stormpath application is always available in Stormpath.");
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Bean
public Application stormpathApplication() {
  //purposefully return the Stormpath admin console app.
  //Real apps would never do this, but this is an easy way to test that bean overrides work:
  for (Application app : client.getApplications()) {
    if (app.getName().equalsIgnoreCase("Stormpath")) { //return the admin app
      return app;
    }
  }
  throw new IllegalStateException("Stormpath application is always available in Stormpath.");
}

代码示例来源:origin: com.stormpath.shiro/stormpath-shiro-core

if (app.getName().equalsIgnoreCase("Stormpath")) { //ignore the admin app
  continue;

代码示例来源:origin: com.stormpath.sdk/stormpath-sdk-servlet

String bearerRealm = String.format("Bearer realm=\"%s\"", application.getName());
response.addHeader("WWW-Authenticate", bearerRealm);
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);

代码示例来源:origin: stormpath/stormpath-sdk-java

String bearerRealm = String.format("Bearer realm=\"%s\"", application.getName());
response.addHeader("WWW-Authenticate", bearerRealm);
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);

代码示例来源:origin: stormpath/stormpath-shiro

if (app.getName().equalsIgnoreCase("Stormpath")) { //ignore the admin app
  continue;

代码示例来源:origin: stormpath/stormpath-sdk-java

if (app.getName().equalsIgnoreCase("Stormpath")) { //ignore the admin app
  continue;

代码示例来源:origin: com.stormpath.spring/stormpath-spring

if (app.getName().equalsIgnoreCase("Stormpath")) { //ignore the admin app
  continue;

代码示例来源:origin: org.pac4j/pac4j-stormpath

@Override
public void validate(final UsernamePasswordCredentials credentials, final WebContext context) throws HttpAction, CredentialsException {
  init(context);
  try {
    logger.debug("Attempting to authenticate user [{}] against application [{}] in Stormpath cloud...",
        credentials.getUsername(), this.application.getName());
    final Account account = authenticateAccount(credentials);
    logger.debug("Successfully authenticated user [{}]", account.getUsername());
    final StormpathProfile profile = createProfile(account);
    credentials.setUserProfile(profile);
  } catch (final ResourceException e) {
    throw new BadCredentialsException("Bad credentials for: " + credentials.getUsername(), e);
  }
}

相关文章