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


Java Algorithm.none方法代码示例

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


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

示例1: testFbJwtCreatorNoneAlgorithmNotAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testFbJwtCreatorNoneAlgorithmNotAllowed() throws Exception {
    thrown.expect(IllegalAccessException.class);
    thrown.expectMessage("None algorithm isn't allowed");

    Algorithm algorithm = Algorithm.none();
    String token = FbJwtCreator.build()
            .withExp(exp)
            .withIat(iat)
            .withUserId(USER_ID)
            .withAppId(APP_ID)
            .setIsNoneAlgorithmAllowed(false)
            .sign(algorithm);
    Verification verification = FbJWT.require(algorithm);
    JWT verifier = verification.createVerifierForFb(USER_ID, APP_ID).build();
    DecodedJWT jwt = verifier.decode(token);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:18,代码来源:FbJwtCreatorTest.java

示例2: testAccessJwtCreatorNoneAlgorithmAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testAccessJwtCreatorNoneAlgorithmAllowed() throws Exception {
    Algorithm algorithm = Algorithm.none();
    String token = AccessJwtCreator.build()
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .setIsNoneAlgorithmAllowed(true)
            .withExp(exp)
            .withIat(iat)
            .sign(algorithm);
    Verification verification = AccessJWT.require(algorithm);
    JWT verifier = verification.createVerifierForAccess(asList("issuer"), asList("audience"), 1, 1).build();
    DecodedJWT jwt = verifier.decode(token);
    Map<String, Claim> claims = jwt.getClaims();
    verifyClaims(claims, exp);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:18,代码来源:AccessJwtCreatorTest.java

示例3: testFbJwtCreatorNoneAlgorithmAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testFbJwtCreatorNoneAlgorithmAllowed() throws Exception {
    Algorithm algorithm = Algorithm.none();
    String token = FbJwtCreator.build()
            .withExp(exp)
            .withIat(iat)
            .withUserId(USER_ID)
            .withAppId(APP_ID)
            .setIsNoneAlgorithmAllowed(true)
            .sign(algorithm);
    Verification verification = FbJWT.require(algorithm);
    JWT verifier = verification.createVerifierForFb(USER_ID, APP_ID).build();
    DecodedJWT jwt = verifier.decode(token);
    Map<String, Claim> claims = jwt.getClaims();
    verifyClaims(claims);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:17,代码来源:FbJwtCreatorTest.java

示例4: testExtendedJwtCreatorNoneAlgorithmAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testExtendedJwtCreatorNoneAlgorithmAllowed() throws Exception {
    Algorithm algorithm = Algorithm.none();
    String token = ExtendedJwtCreator.build()
            .withNbf(nbf)
            .withPicture(PICTURE)
            .withEmail(EMAIL)
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .withExp(exp)
            .withIat(iat)
            .withName(NAME)
            .setIsNoneAlgorithmAllowed(true)
            .sign(algorithm);

    GoogleVerification verification = ExtendedJWT.require(algorithm);
    JWT verifier = verification.createVerifierForExtended(PICTURE, EMAIL, asList("issuer"), asList("audience"),
            NAME, 1, 1, 1).build();
    DecodedJWT jwt = verifier.decode(token);
    Map<String, Claim> claims = jwt.getClaims();
    verifyClaims(claims, exp);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:24,代码来源:ExtendedJwtCreatorTest.java

示例5: testScopedJwtCreatorNoneAlgorithmNotSpecifiedButStillNotAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testScopedJwtCreatorNoneAlgorithmNotSpecifiedButStillNotAllowed() throws Exception {
    thrown.expect(IllegalAccessException.class);
    thrown.expectMessage("None algorithm isn't allowed");

    Algorithm algorithm = Algorithm.none();
    String token = ScopedJwtCreator.build()
            .withScope("scope")
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .withExp(exp)
            .withIat(iat)
            .sign(algorithm);

    Verification verification = ScopedJWT.require(algorithm);
    JWT verifier = verification.createVerifierForScoped("scope", asList("issuer"), asList("audience"), 1, 1).build();
    DecodedJWT jwt = verifier.decode(token);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:20,代码来源:ScopedJwtCreatorTest.java

示例6: testScopedJwtCreatorNoneAlgorithmAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testScopedJwtCreatorNoneAlgorithmAllowed() throws Exception {
    Algorithm algorithm = Algorithm.none();
    String token = ScopedJwtCreator.build()
            .withScope("scope")
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .setIsNoneAlgorithmAllowed(true)
            .withExp(exp)
            .withIat(iat)
            .sign(algorithm);
    Verification verification = ScopedJWT.require(algorithm);
    JWT verifier = verification.createVerifierForScoped("scope", asList("issuer"), asList("audience"), 1, 1).build();
    DecodedJWT jwt = verifier.decode(token);
    Map<String, Claim> claims = jwt.getClaims();
    verifyClaims(claims, exp);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:19,代码来源:ScopedJwtCreatorTest.java

示例7: testRiscJwtCreatorNoneAlgorithmNotAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testRiscJwtCreatorNoneAlgorithmNotAllowed() throws Exception {
    thrown.expect(IllegalAccessException.class);
    thrown.expectMessage("None algorithm isn't allowed");

    Algorithm algorithm = Algorithm.none();
    String token = RiscJwtCreator.build()
            .withJWTId(jti)
            .withNbf(nbf)
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .withExp(exp)
            .withIat(iat)
            .setIsNoneAlgorithmAllowed(false)
            .sign(algorithm);
    Verification verification = RiscJWT.require(algorithm);
    JWT verifier = verification.createVerifierForRisc(jti, asList("issuer"), asList("audience"), 1, 1, 1).build();
    DecodedJWT jwt = verifier.decode(token);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:21,代码来源:RiscJwtCreatorTest.java

示例8: testRiscJwtCreatorNoneAlgorithmNotSpecifiedButStillNotAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testRiscJwtCreatorNoneAlgorithmNotSpecifiedButStillNotAllowed() throws Exception {
    thrown.expect(IllegalAccessException.class);
    thrown.expectMessage("None algorithm isn't allowed");

    Algorithm algorithm = Algorithm.none();
    String token = RiscJwtCreator.build()
            .withJWTId(jti)
            .withNbf(nbf)
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .withExp(exp)
            .withIat(iat)
            .sign(algorithm);
    Verification verification = RiscJWT.require(algorithm);
    JWT verifier = verification.createVerifierForRisc(jti, asList("issuer"), asList("audience"), 1, 1, 1).build();
    DecodedJWT jwt = verifier.decode(token);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:20,代码来源:RiscJwtCreatorTest.java

示例9: testRiscJwtCreatorNoneAlgorithmAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testRiscJwtCreatorNoneAlgorithmAllowed() throws Exception {
    Algorithm algorithm = Algorithm.none();
    String token = RiscJwtCreator.build()
            .withJWTId(jti)
            .withNbf(nbf)
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .withExp(exp)
            .withIat(iat)
            .setIsNoneAlgorithmAllowed(true)
            .sign(algorithm);
    Verification verification = RiscJWT.require(algorithm);
    JWT verifier = verification.createVerifierForRisc(jti, asList("issuer"), asList("audience"), 1, 1, 1).build();
    DecodedJWT jwt = verifier.decode(token);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:18,代码来源:RiscJwtCreatorTest.java

示例10: testImplicitJwtCreatorNoneAlgorithmNotAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testImplicitJwtCreatorNoneAlgorithmNotAllowed() throws Exception {
    thrown.expect(IllegalAccessException.class);
    thrown.expectMessage("None algorithm isn't allowed");

    Algorithm algorithm = Algorithm.none();
    String token = ImplicitJwtCreator.build()
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .setIsNoneAlgorithmAllowed(false)
            .withIat(iat)
            .sign(algorithm);

    Verification verification = ImplicitJWT.require(algorithm);
    JWT verifier = verification.createVerifierForImplicit(asList("issuer"), asList("audience"), 1).build();
    DecodedJWT jwt = verifier.decode(token);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:19,代码来源:ImplicitJwtCreatorTest.java

示例11: testImplicitJwtCreatorNoneAlgorithmNotSpecifiedButStillNotAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testImplicitJwtCreatorNoneAlgorithmNotSpecifiedButStillNotAllowed() throws Exception {
    thrown.expect(IllegalAccessException.class);
    thrown.expectMessage("None algorithm isn't allowed");

    Algorithm algorithm = Algorithm.none();
    String token = ImplicitJwtCreator.build()
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .withIat(iat)
            .sign(algorithm);
    Verification verification = ImplicitJWT.require(algorithm);
    JWT verifier = verification.createVerifierForImplicit(asList("issuer"), asList("audience"), 1).build();
    DecodedJWT jwt = verifier.decode(token);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:17,代码来源:ImplicitJwtCreatorTest.java

示例12: testImplicitJwtCreatorNoneAlgorithmAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testImplicitJwtCreatorNoneAlgorithmAllowed() throws Exception {
    Algorithm algorithm = Algorithm.none();
    String token = ImplicitJwtCreator.build()
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .setIsNoneAlgorithmAllowed(true)
            .withIat(iat)
            .sign(algorithm);
    Verification verification = ImplicitJWT.require(algorithm);
    JWT verifier = verification.createVerifierForImplicit(asList("issuer"), asList("audience"), 1).build();
    DecodedJWT jwt = verifier.decode(token);
    Map<String, Claim> claims = jwt.getClaims();
    verifyClaims(claims);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:17,代码来源:ImplicitJwtCreatorTest.java

示例13: testGoogleJwtCreatorNoneAlgorithmNotAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testGoogleJwtCreatorNoneAlgorithmNotAllowed() throws Exception {
    thrown.expect(IllegalAccessException.class);
    thrown.expectMessage("None algorithm isn't allowed");

    Algorithm algorithm = Algorithm.none();
    String token = GoogleJwtCreator.build()
            .withPicture(PICTURE)
            .withEmail(EMAIL)
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .withExp(exp)
            .withIat(iat)
            .withName(NAME)
            .setIsNoneAlgorithmAllowed(false)
            .sign(algorithm);

    GoogleVerification verification = GoogleJWT.require(algorithm);
    JWT verifier = verification.createVerifierForGoogle(PICTURE, EMAIL, asList("issuer"), asList("audience"),
             NAME, 1, 1).build();
    DecodedJWT jwt = verifier.decode(token);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:24,代码来源:GoogleJwtCreatorTest.java

示例14: testExtendedJwtCreatorNoneAlgorithmNotSpecifiedButStillNotAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testExtendedJwtCreatorNoneAlgorithmNotSpecifiedButStillNotAllowed() throws Exception {
    thrown.expect(IllegalAccessException.class);
    thrown.expectMessage("None algorithm isn't allowed");

    Algorithm algorithm = Algorithm.none();
    String token = ExtendedJwtCreator.build()
            .withNbf(nbf)
            .withPicture(PICTURE)
            .withEmail(EMAIL)
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .withExp(exp)
            .withIat(iat)
            .withName(NAME)
            .setIsNoneAlgorithmAllowed(false)
            .sign(algorithm);

    GoogleVerification verification = ExtendedJWT.require(algorithm);
    JWT verifier = verification.createVerifierForExtended(PICTURE, EMAIL, asList("issuer"), asList("audience"),
            NAME, 1, 1, 1).build();
    DecodedJWT jwt = verifier.decode(token);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:25,代码来源:ExtendedJwtCreatorTest.java

示例15: testGoogleJwtCreatorNoneAlgorithmAllowed

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
@Test
public void testGoogleJwtCreatorNoneAlgorithmAllowed() throws Exception {
    Algorithm algorithm = Algorithm.none();
    String token = GoogleJwtCreator.build()
            .withPicture(PICTURE)
            .withEmail(EMAIL)
            .withIssuer("issuer")
            .withSubject("subject")
            .withAudience("audience")
            .withExp(exp)
            .withIat(iat)
            .withName(NAME)
            .setIsNoneAlgorithmAllowed(true)
            .sign(algorithm);

    GoogleVerification verification = GoogleJWT.require(algorithm);
    JWT verifier = verification.createVerifierForGoogle(PICTURE, EMAIL, asList("issuer"), asList("audience"),
             NAME, 1, 1).build();
    DecodedJWT jwt = verifier.decode(token);
    Map<String, Claim> claims = jwt.getClaims();
    verifyClaims(claims, exp);
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:23,代码来源:GoogleJwtCreatorTest.java


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