-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling error: UnsupportedGrantTypeException, Unsupported grant type: password #3
Comments
步骤一、在com.newnil.cas.oauth2.provider.config中的SecurityConfig增加如下代码:
步骤二、在com.newnil.cas.oauth2.provider.config.OAuth2ServerConfig中的OAuth2ServerConfig里面增加如下代码:
执行上面就可以支持grant_type=password了,但是----com.newnil.cas.oauth2.provider.service.DatabaseTokenStoreService中第51行、90行(accessTokenRepository.save(entityToSave);)、111行(refreshTokenRepository.save(entityToSave);)会报:
|
出现json转转化错误的原因是org.springframework.security.oauth2.common.DefaultExpiringOAuth2RefreshToken中没有默认构造方法,com.newnil.cas.oauth2.provider.dao.entity.util.JsonPersistenceConverters中使用com.fasterxml.jackson.databind.ObjectMapper进行json转换时就会出错。我的解决方法是定一个MyDefaultExpiringOAuth2RefreshToken继承自DefaultExpiringOAuth2RefreshToken如下:
然后使用该类进行转换转换后再拷贝给DefaultExpiringOAuth2RefreshToken进行中转,我在. com.newnil.cas.oauth2.provider.dao.entity.util直接中转如:
|
感谢您的issue。
|
我配置了一个grant_type=password的客户端,授权访问时会报:
The text was updated successfully, but these errors were encountered: