Class WebviewService
java.lang.Object
es.kukenan.smartfi.microservice.security.gateway.service.WebviewService
Webview related operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPath for Contracts of BE.private es.kukenan.smartfi.common.context.RequestContextManagerRequest context manager.private JwtTokenUtilitiesService utilities for manage jwt token.private StringProducts host.private es.kukenan.smartfi.common.context.config.ContextPropagationPropertiesContext propagation properties.private org.springframework.web.client.RestTemplateRest template.private SessionCacheUtilitiesSession cache utilities.private WebviewCacheUtilitiesSession cache utilities. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate es.kukenan.smartfi.common.service.jwt.JwtBearerTokengenerateJwtFromNativeJwt(es.kukenan.smartfi.common.service.jwt.JwtBearerToken nativeJwt, String deviceId) private voidgetContractsCall(es.kukenan.smartfi.microservice.security.gateway.cache.model.SessionCache sessionCache) es.kukenan.smartfi.microservice.security.gateway.api.WebviewLoginDtogetWebviewToken(String uuid) Create a token for webview hybridization for native uuid.voidloginWebview(String uuid, es.kukenan.smartfi.microservice.security.gateway.api.WebviewLoginDto body) Login webview hybridization.private es.kukenan.smartfi.microservice.security.gateway.cache.model.SessionCacheupdateSessionWebClient(es.kukenan.smartfi.microservice.security.gateway.cache.model.SessionCache cacheWeb, es.kukenan.smartfi.microservice.security.gateway.cache.model.SessionCache cacheNative, String webclientDeviceId) Update the session for webclient based on native session asociated.
-
Field Details
-
API_CONTRACTS_PATH
Path for Contracts of BE.- See Also:
-
productsHost
Products host. -
sessionCacheUtilities
Session cache utilities. -
webviewCacheUtilities
Session cache utilities. -
jwtTokenUtilities
Service utilities for manage jwt token. -
restTemplate
@Autowired private org.springframework.web.client.RestTemplate restTemplateRest template. -
properties
@Autowired private es.kukenan.smartfi.common.context.config.ContextPropagationProperties propertiesContext propagation properties. -
contextManager
@Autowired private es.kukenan.smartfi.common.context.RequestContextManager contextManagerRequest context manager.
-
-
Constructor Details
-
WebviewService
public WebviewService()
-
-
Method Details
-
getWebviewToken
public es.kukenan.smartfi.microservice.security.gateway.api.WebviewLoginDto getWebviewToken(String uuid) Create a token for webview hybridization for native uuid.- Parameters:
uuid- unique identifier for session cache.- Returns:
- webview token
-
loginWebview
public void loginWebview(String uuid, es.kukenan.smartfi.microservice.security.gateway.api.WebviewLoginDto body) throws URISyntaxException Login webview hybridization.- Parameters:
uuid- unique identifier for session cache.body- request with unique identifier for token webview.- Throws:
URISyntaxException- Uri syntax exception
-
updateSessionWebClient
private es.kukenan.smartfi.microservice.security.gateway.cache.model.SessionCache updateSessionWebClient(es.kukenan.smartfi.microservice.security.gateway.cache.model.SessionCache cacheWeb, es.kukenan.smartfi.microservice.security.gateway.cache.model.SessionCache cacheNative, String webclientDeviceId) Update the session for webclient based on native session asociated.- Parameters:
cacheWeb- actual session for webclientcacheNative- token with native sessionwebclientDeviceId- device identifier for webclient- Returns:
- new session cache
-
generateJwtFromNativeJwt
private es.kukenan.smartfi.common.service.jwt.JwtBearerToken generateJwtFromNativeJwt(es.kukenan.smartfi.common.service.jwt.JwtBearerToken nativeJwt, String deviceId) -
getContractsCall
private void getContractsCall(es.kukenan.smartfi.microservice.security.gateway.cache.model.SessionCache sessionCache) throws URISyntaxException - Throws:
URISyntaxException
-