当前位置: 首页>>代码示例>>Java>>正文


Java UsernamePasswordCredential.setPassword方法代码示例

本文整理汇总了Java中org.jasig.cas.authentication.UsernamePasswordCredential.setPassword方法的典型用法代码示例。如果您正苦于以下问题:Java UsernamePasswordCredential.setPassword方法的具体用法?Java UsernamePasswordCredential.setPassword怎么用?Java UsernamePasswordCredential.setPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jasig.cas.authentication.UsernamePasswordCredential的用法示例。


在下文中一共展示了UsernamePasswordCredential.setPassword方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCredentialsWithDifferentUsernameAndPassword

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
public static UsernamePasswordCredential getCredentialsWithDifferentUsernameAndPassword(
        final String username, final String password) {
    final UsernamePasswordCredential usernamePasswordCredentials = new UsernamePasswordCredential();
    usernamePasswordCredentials.setUsername(username);
    usernamePasswordCredentials.setPassword(password);

    return usernamePasswordCredentials;
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:9,代码来源:TestUtils.java

示例2: verifyAuthenticatesUserInFileWithCommaSeparator

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test
public void verifyAuthenticatesUserInFileWithCommaSeparator() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    this.authenticationHandler.setFileName(
            new ClassPathResource("org/jasig/cas/adaptors/generic/authentication2.txt"));
    this.authenticationHandler.setSeparator(",");

    c.setUsername("scott");
    c.setPassword("rutgers");

    assertNotNull(this.authenticationHandler.authenticate(c));
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:14,代码来源:FileAuthenticationHandlerTests.java

示例3: verifyFailsUserInMap

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test(expected=FailedLoginException.class)
public void verifyFailsUserInMap() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    c.setUsername("scott");
    c.setPassword("rutgers");
    this.authenticationHandler.authenticate(c);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:9,代码来源:RejectUsersAuthenticationHandlerTests.java

示例4: verifyPassesUserNotInMap

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test
public void verifyPassesUserNotInMap() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    c.setUsername("fds");
    c.setPassword("rutgers");

    assertNotNull(this.authenticationHandler.authenticate(c));
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:10,代码来源:RejectUsersAuthenticationHandlerTests.java

示例5: verifyPassesNullUserName

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test(expected = AccountNotFoundException.class)
public void verifyPassesNullUserName() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    c.setUsername(null);
    c.setPassword("user");

    this.authenticationHandler.authenticate(c);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:10,代码来源:RejectUsersAuthenticationHandlerTests.java

示例6: verifyAuthenticatesUserInFileWithDefaultSeparator

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test
public void verifyAuthenticatesUserInFileWithDefaultSeparator() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    c.setUsername("scott");
    c.setPassword("rutgers");

    assertNotNull(this.authenticationHandler.authenticate(c));
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:10,代码来源:FileAuthenticationHandlerTests.java

示例7: verifyFailsUserNotInFileWithCommaSeparator

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test(expected = AccountNotFoundException.class)
public void verifyFailsUserNotInFileWithCommaSeparator() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    this.authenticationHandler.setFileName(
            new ClassPathResource("org/jasig/cas/adaptors/generic/authentication2.txt"));
    this.authenticationHandler.setSeparator(",");

    c.setUsername("fds");
    c.setPassword("rutgers");
    this.authenticationHandler.authenticate(c);
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:13,代码来源:FileAuthenticationHandlerTests.java

示例8: verifyFailsNullUserName

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test(expected = AccountNotFoundException.class)
public void verifyFailsNullUserName() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    c.setUsername(null);
    c.setPassword("user");
    this.authenticationHandler.authenticate(c);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:9,代码来源:FileAuthenticationHandlerTests.java

示例9: testFailsGoodUsernameBadPassword

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test(expected = FailedLoginException.class)
public void testFailsGoodUsernameBadPassword() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    this.authenticationHandler.setFileName(
            new ClassPathResource("org/jasig/cas/adaptors/generic/authentication2.txt"));
    this.authenticationHandler.setSeparator(",");

    c.setUsername("scott");
    c.setPassword("rutgers1");

    this.authenticationHandler.authenticate(c);
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:14,代码来源:FileAuthenticationHandlerTests.java

示例10: verifyFailsNullPassword

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test(expected = FailedLoginException.class)
public void verifyFailsNullPassword() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    c.setUsername("scott");
    c.setPassword(null);

    this.authenticationHandler.authenticate(c);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:10,代码来源:FileAuthenticationHandlerTests.java

示例11: testFailsNullUserNameAndPassword

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test(expected = AccountNotFoundException.class)
public void testFailsNullUserNameAndPassword() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    c.setUsername(null);
    c.setPassword(null);
    this.authenticationHandler.authenticate(c);
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:9,代码来源:FileAuthenticationHandlerTests.java

示例12: verifyFailsGoodUsernameBadPassword

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test(expected = FailedLoginException.class)
public void verifyFailsGoodUsernameBadPassword() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    this.authenticationHandler.setFileName(
            new ClassPathResource("org/jasig/cas/adaptors/generic/authentication2.txt"));
    this.authenticationHandler.setSeparator(",");

    c.setUsername("scott");
    c.setPassword("rutgers1");

    this.authenticationHandler.authenticate(c);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:14,代码来源:FileAuthenticationHandlerTests.java

示例13: verifyAuthenticateNoFileName

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test(expected = PreventedException.class)
public void verifyAuthenticateNoFileName() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();
    this.authenticationHandler.setFileName(new ClassPathResource("fff"));

    c.setUsername("scott");
    c.setPassword("rutgers");

    this.authenticationHandler.authenticate(c);
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:11,代码来源:FileAuthenticationHandlerTests.java

示例14: testSupportsProperUserCredentials

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test
public void testSupportsProperUserCredentials() throws Exception {
    UsernamePasswordCredential c = new UsernamePasswordCredential();

    c.setUsername("fff");
    c.setPassword("rutgers");
    assertNotNull(this.authenticationHandler.authenticate(c));
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:9,代码来源:RejectUsersAuthenticationHandlerTests.java

示例15: testFailsUserNotInFileWithDefaultSeparator

import org.jasig.cas.authentication.UsernamePasswordCredential; //导入方法依赖的package包/类
@Test(expected = AccountNotFoundException.class)
public void testFailsUserNotInFileWithDefaultSeparator() throws Exception {
    final UsernamePasswordCredential c = new UsernamePasswordCredential();

    c.setUsername("fds");
    c.setPassword("rutgers");
    this.authenticationHandler.authenticate(c);
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:9,代码来源:FileAuthenticationHandlerTests.java


注:本文中的org.jasig.cas.authentication.UsernamePasswordCredential.setPassword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。