我正在尝试在 pom.xml 中添加 jwt,但 jwt 依赖项不可用。
有没有人有同样的经历?
我将使用 Jwtbuilder 进行安全设置。
Springboot 是 2.2.6,我正在使用 Maven。
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>co.kr.hatchfly</groupId>
<artifactId>hf</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>hf</name>
<description>hatchfly home</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
我期待实现jjwt在我的应用程序,并寻求实施jjwt,当我用Google搜索,我发现这两个行家依赖不知道哪一个挑,为什么?
<jjwt.version>0.7.0</jjwt.version>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jjwt.version}</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
和其他是
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>5.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我在两个API库中都玩过POC,但不确定哪个是可扩展的解决方案.我正在开发Spring MVC+ Spring Security+ Spring REST+ HATEOAS+ CORS+ Spring Batch所有后端代码都将部署在tomcat前端,AngularJS并将部署在nodejs上.
希望这些信息足以回答这个问题.
我正在调查 Google 在我的 Android 应用程序中提供的 SafetyNet。
首先,我简单地调用了 SafetyNet attest API,然后 Base64 对这些部分进行了解码,如 Google 提供的示例所示。
SafetyNet.getClient(this).attest(NONCE, <API KEY>)
.addOnSuccessListener(this, new OnSuccessListener<SafetyNetApi.AttestationResponse>() {
@Override
public void onSuccess(final SafetyNetApi.AttestationResponse attestationResponse) {
initialDataExtraction(attestationResponse.getJwsResult());
}
})
.addOnFailureListener(this, new OnFailureListener() {
@Override
public void onFailure(@NonNull final Exception exception) {
if (exception instanceof ApiException) {
final ApiException apiException = (ApiException) exception;
Log.e(TAG, "onFailure: " + apiException.getMessage() + " " + apiException.getStatusCode());
} else {
Log.e(TAG, "Error: ", exception);
}
}
});
Run Code Online (Sandbox Code Playgroud)
我提取 JWS 部分如下:-
private byte[] initialDataExtraction(final …Run Code Online (Sandbox Code Playgroud) 我应该在 pom.xml 中添加哪个 Maven 依赖项来解决这些错误: -SignatureException 无法解析为类型 -ExpiredJwtException 无法解析为类型 -UnsupportedJwtException 无法解析为类型