diff --git a/src/main/java/com/eactive/eai/authoutbound/client/impl/HttpClientAccessTokenServiceWithFixedToken.java b/src/main/java/com/eactive/eai/authoutbound/client/impl/HttpClientAccessTokenServiceWithFixedToken.java new file mode 100644 index 0000000..aae9f06 --- /dev/null +++ b/src/main/java/com/eactive/eai/authoutbound/client/impl/HttpClientAccessTokenServiceWithFixedToken.java @@ -0,0 +1,27 @@ +package com.eactive.eai.authoutbound.client.impl; + +import java.util.Properties; + +import com.eactive.eai.authoutbound.OutboundOAuthCredentialVo; +import com.eactive.eai.authoutbound.client.HttpClientAccessTokenServiceByDB; +import com.openbanking.eai.common.token.OAuth2AccessTokenVO; + +public class HttpClientAccessTokenServiceWithFixedToken implements HttpClientAccessTokenServiceByDB { + + @Override + public Object execute(String adapterGroupName, Properties adapterProp, OutboundOAuthCredentialVo oAuthCredentialVo) + throws Exception { + + OAuth2AccessTokenVO fixedAccessToken = new OAuth2AccessTokenVO(); + + fixedAccessToken.setAccessToken(oAuthCredentialVo.getClientSecret()); + fixedAccessToken.setClientId("none"); + fixedAccessToken.setClientUseCode("anyone"); + fixedAccessToken.setExpiresIn(60 * 60 * 24 * 365); //1년 + fixedAccessToken.setScope("none"); + fixedAccessToken.setTokenType("fixed"); + + return fixedAccessToken; + } + +}