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

io.mosip.kernel.openid.bridge.api.utils.AuthCodeProxyFlowUtils Maven / Gradle / Ivy

There is a newer version: 1.3.0-beta.1
Show newest version
package io.mosip.kernel.openid.bridge.api.utils;

import java.util.HashMap;
import java.util.Map;

import com.auth0.jwt.JWT;
import com.auth0.jwt.interfaces.DecodedJWT;

public class AuthCodeProxyFlowUtils {
	
	private AuthCodeProxyFlowUtils() {
		
	}

	static Map decodedJWTCache = new HashMap<>();
	
	public static String getissuer(String token) {
		DecodedJWT decodedJWT  = null;
		if(decodedJWTCache.get(token)!=null)
			decodedJWT = decodedJWTCache.get(token);
		else{
			decodedJWT = JWT.decode(token);
			decodedJWTCache.put(token, decodedJWT);
		}	
		return decodedJWT.getClaim("iss").asString();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy