本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}