クロエ:
私はコンタクトセンターExpressでの認証にサードパーティのアプリケーションを構築しています。ドキュメントは必要であるが、これを実現するには不十分。例えば、
// Get Access Token for the received Authorization Code
String redirectURI = config.getRedirectUri();
AccessToken token = client.getAccessToken(authCode, redirectURI);
いつ、どこで認証するために、コンタクトセンターにユーザーをリダイレクトするのですか?私はフィネスがにユーザーをリダイレクトすることを観察しました
しかし、ここでそれはアイデンティティサービス(IDS)のパスを使用するように指定されていますか/ids/v1/oauth/authorize
?そして、状態は必要なパラメータですか?そして、IDS SDKは、コールバックパスを処理しませんか/desktop/sso/authcode
?私はそれがないことを想像しますが、それに送信されるパラメータは何ですか?私は、Springフレームワークを使用しています。
私は、全体のプロセスをリバースエンジニアリングしたり、私が行方不明だと追加のドキュメントがあるのですか?
私はOAuthのトークンを受け取った後でも、どのように私は他のシスコ製品に他のREST呼び出しを行うためにそれを使用するのでしょうか?フィネスREST APIはHTTPのみ基本認証を言及します。トークン:「ベアラ認証」のヘッダーの言及はありません。
https://developer.cisco.com/docs/finesse/#!sign-in-to-finesse/sign-in-to-finesse
クロエ:
私はすべてのリダイレクト、次のことをリバースエンジニアリングする必要がありました。
@Controller
public class SSOController {
@Autowired
private IdSClientConfigurationImpl config;
@Autowired
private IdSClient client;
@PostMapping("/login")
public String login(@RequestParam(name="user", required=true) String user) {
// redirect the user to the Cisco Contact Center Express Identity Service
String redirectURI = config.getRedirectUri();
String clientId = config.getClientId();
URI uri = UriComponentsBuilder
.fromUriString("https://contact-center-express:8553/ids/v1/oauth/authorize")
.queryParam("redirect_uri", "{redirect_uri}")
.queryParam("client_id", "{client_id}")
// .queryParam("state", "{state}") // base64 encoded
.queryParam("response_type", "code")
.build(redirectURI, clientId);
return "redirect:"+uri.toString();
}
@GetMapping("/idscallback")
public String idscallback(
@RequestParam(name="code", required=true) String code,
@RequestParam(name="state", required=false) String state,
HttpSession session) throws IdSClientException {
// Get Access Token for the received Authorization Code
String redirectURI = config.getRedirectUri();
AccessToken token = client.getAccessToken(code, redirectURI); // why do I need redirectURI when it's already redirected?
String accessTokenString = token.getAccess_token();
session.setAttribute("token", accessTokenString);
// model.addAttribute("token", accessTokenString);
return "redirect:/";
}
そして遠く、遠く離れた豆で...
@Bean
public IdSClientConfigurationImpl config() throws IOException, IdSClientException {
ClassPathResource idsclientResource = new ClassPathResource("idsclient.properties");
IdSClientConfigurationImpl config = new IdSClientConfigurationImpl(idsclientResource.getFile().getPath());
// IdSClientConfigurationImpl config = new IdSClientConfigurationImpl("src/main/resources/idsclient.properties");
config.load();
return config;
}
@Bean
public IdSClient setupIdsClient() throws IOException, IdSClientException {
IdSClient client = IdSClientFactory.getIdSClient();
client.setTLSContext(createSSLTrustManager(), createHostnameVerifier());
// client.setTLSContext(arg0, arg1) // use secure trust manager and hostname verifier in production
client.init(config);
return client;
}
private X509TrustManager createSSLTrustManager() {
X509TrustManager tm = new TrustAllX509TrustManager();
return tm;
}
private HostnameVerifier createHostnameVerifier() {
HostnameVerifier hv = new SkipAllHostNameVerifier();
return hv;
}