小编Nav*_*mar的帖子

Spring Boot + OAuth + JWT + MySQL刷新令牌第二次不起作用

我正在使用Spring Boot,OAuth2,JWT自定义令牌和MySQL。

问题:我能够使用刷新令牌来获取令牌和刷新令牌,如果我再次尝试使用新的刷新令牌来获取新令牌,则只能按时获取新令牌,这意味着我遇到以下错误。

错误信息

{
"error": "invalid_grant",
"error_description": "Invalid refresh token: eyJhbGciOiJSUzI1NiJ9.eyJsb2dpbklkIjoibmF2ZWVuIiwidXNlcl9uYW1lIjoibmF2ZWVuIiwic2NvcGUiOlsiY2l0eSIsInJlYWQiLCJ3cml0ZSJdLCJhdGkiOiI4YmVlMzZhZi1lZWM1LTQzODItYjNkZi1jYTU3Mjc0NjQ5N2MiLCJleHAiOjE0NzUyMjc4NzUsImF1dGhvcml0aWVzIjpbIlRlc3RlciIsIlVzZXIiLCJBZG1pbiIsImNhbXBhaWduLWNhbmFsbCIsIm9yZy1jYW5hbGwiXSwianRpIjoiNjE1OWM4NTYtYTZmNi00Njg3LTg3OTMtMTA1NDdkODE4YmVhIiwiY2xpZW50X2lkIjoiY2l0eUNsaWVudElkIn0.FvA821Hv0ZzA6mdwNp-XlcHAy6tCncP8snkQDlmDWulFE-BIe-KxTT0ugjoK2l1ncAQugtyfXCnS_a0bgAPcu1HKmYgIvj4f3XBj1WLRagiDfJqjZAwZhDPvrwks7W1IsvWrzy5k-pmoO7373C5DU0jbFsanzkvMQ6LQAwb_bFfOB3GYH5BSIW4rcbe8AH1B3QKxn9J26Jj1yQWnkY8HnUqnxN5C-3jBwr8pvqPmX2AjOVeAnkoGfY6B3Dq1vz8EE17I8GG2uqGgUsaTiVqP3Lka__ue00MjajxcpVHeh7t1Qs0IbTa2oeuahAwcYOC_ik_Rplhn3w-LHpyhPBrTHA"
}
Run Code Online (Sandbox Code Playgroud)

请找到身份验证服务器和资源服务器配置文件。我找不到我做错了的地方。

授权服务器

@Configuration
@EnableAuthorizationServer
public class AuthorizationServerConfig extends  AuthorizationServerConfigurerAdapter {

@Autowired
private DataSource dataSource;

@Autowired
@Qualifier("authenticationManagerBean")
private AuthenticationManager authenticationManager;

@Autowired
@Qualifier("userDetailsService")
UserDetailsService userDetailsService;

@Override
public void configure(final AuthorizationServerSecurityConfigurer oauthServer) throws Exception {
    oauthServer.tokenKeyAccess("permitAll()").checkTokenAccess("isAuthenticated()");
            //.passwordEncoder(passwordEncoder());
}

@Bean
public PasswordEncoder passwordEncoder() {
    CustomPasswordEncoder encoder = new CustomPasswordEncoder();
    return encoder;
}

@Override
public void configure(final ClientDetailsServiceConfigurer clients) throws Exception {
    clients.jdbc(dataSource);
}

@Override
public void configure(final AuthorizationServerEndpointsConfigurer endpoints) throws …
Run Code Online (Sandbox Code Playgroud)

mysql oauth-2.0 jwt spring-boot spring-security-oauth2

7
推荐指数
2
解决办法
2477
查看次数

无法初始化类com.amazonaws.services.sqs.AmazonSQSClient

首先,我是JAVA AWS Eclipse Maven Tomcat的新手...我在尝试下面的代码时遇到以下错误.错误是"HTTP状态500 - java.lang.NoClassDefFoundError:无法初始化类com.amazonaws.services.sqs. AmazonSQSClient" ...

package sms.pii.webservice;

import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.AmazonSQSClient;
import com.amazonaws.services.sqs.model.*;

public class AWSSimpleQueueServiceUtil {

public BasicAWSCredentials credentials;
public AmazonSQS sqs;


public AWSSimpleQueueServiceUtil(){
    try{
        String accessKey= "xxxxxx";
        String secretKey= "xxxxxxxx";
        this.credentials = new BasicAWSCredentials(accessKey,secretKey);
        this.sqs = new AmazonSQSClient(this.credentials);
        //this.sqs.setEndpoint("https://sqs.ap-southeast-1.amazonaws.com");

    }
    catch(Exception e){
        System.out.println("exception while creating awss3client : " + e);
    }
}

public String createNewQueue(String queueName){
    CreateQueueRequest createQueueRequest = new CreateQueueRequest(queueName);
    String queueUrl = this.sqs.createQueue(createQueueRequest).getQueueUrl();
    return queueUrl;
}

public String getQueueUrlByName(String queueName){ …
Run Code Online (Sandbox Code Playgroud)

java eclipse tomcat amazon-web-services maven

6
推荐指数
1
解决办法
3617
查看次数

如何使用javascript或jquery在asp.net应用程序中禁用右键单击,f12(调试)和ctrl + s

如何在asp.net应用程序中使用javascript或jquery禁用右键单击,f12(调试)和ctrl + s ..必须黑色ctrl + s - >不允许保存页面必须黑色f12并右键单击 - >不允许检查/调试/查看页面源

javascript asp.net-mvc jquery html5

-2
推荐指数
1
解决办法
1912
查看次数