Search in sources :

Example 1 with JWTClientManagerService

use of org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService in project product-iots by wso2.

the class APIUtil method getJWTClientManagerService.

/**
 * @return JWTClient manager of current context
 */
public static JWTClientManagerService getJWTClientManagerService() {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    JWTClientManagerService jwtClientManagerService = (JWTClientManagerService) ctx.getOSGiService(JWTClientManagerService.class, null);
    if (jwtClientManagerService == null) {
        String msg = "JWT Client manager service has not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    return jwtClientManagerService;
}
Also used : JWTClientManagerService(org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService) PrivilegedCarbonContext(org.wso2.carbon.context.PrivilegedCarbonContext)

Aggregations

PrivilegedCarbonContext (org.wso2.carbon.context.PrivilegedCarbonContext)1 JWTClientManagerService (org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService)1