如何填写Spring Security身份验证详细信息?

时间:2019-06-14 08:58:10

标签: json spring security grails

我在Grails(Spring Security)中为我的API提供了一个自定义提供程序:

@Component class ApiAuthenticationProvider implements AuthenticationProvider {

    @Autowired
    TokenGenerator tokenGenerator

    @Autowired
    PasswordEncoder passwordEncoder

    @Autowired
    ApiTokenStorageService tokenStorageService

    @Override
    Authentication authenticate(Authentication authentication) throws AuthenticationException {
    ...
    authentication.getDetails()     }

现在我有我发送的Json: { "username" : "username", "password" : "password123", "details" : {"uuid":"0000-0000-0000-0000-0000000"} }

我可以在身份验证方法中获得用户名和密码,但不能获得“ uuid”。身份验证中的这些详细信息如何工作?

0 个答案:

没有答案