All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.auth0.jwt.impl.BasicPayloadHandler Maven / Gradle / Ivy

There is a newer version: 4.4.0
Show newest version
package com.auth0.jwt.impl;

import com.auth0.jwt.PayloadHandler;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * Basic implementation of a payload handler which serializes the payload to a String, and echoes it for deserialization
 */
public final class BasicPayloadHandler implements PayloadHandler {

	public String encoding(Object payload) throws Exception {
		return new ObjectMapper().writeValueAsString(payload);
	}
	
	public Object decoding(String payload) throws Exception {
		return payload;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy