Example usage for org.springframework.security.jwt Jwt getEncoded

List of usage examples for org.springframework.security.jwt Jwt getEncoded

Introduction

In this page you can find the example usage for org.springframework.security.jwt Jwt getEncoded.

Prototype

String getEncoded();

Source Link

Usage

From source file:org.springframework.security.jwt.filter.DefaultJwtTokenService.java

@Override
public String sign(Map<String, Object> claims) {
    try {/*from  www  .j av a  2 s.c om*/
        Jwt jwt = JwtHelper.encode(objectMapper.writeValueAsString(claims), signerVerifier);
        return jwt.getEncoded();
    } catch (JsonProcessingException e) {
        e.printStackTrace();
        // TODO
        return null;
    }
}