web stats
Issue getting a response from Security Token Service - Page 2 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #11  
Old 04-16-2018, 09:26 AM
seaston seaston is offline
OBX.3 Kenobi
 
Join Date: Feb 2010
Location: London, UK
Posts: 168
seaston is on a distinguished road
Default

This is the error at the STS side:

Code:
ERROR [io.undertow.request] (default task-6) UT005023: Exception handling request to /SpiritIdentityProvider2/lhciejwtsts: javax.servlet.ServletException: javax.servlet.ServletException: Wrong content Type
       at com.spirit.sts.LHCIEJwtReceiver.doPost(LHCIEJwtReceiver.java:169)
{ POST /Spirit
IdentityProvider2/lhciejwtsts request {connection=[Keep-Alive], authorization=[LHCIE-JWT eyJTdWJqZWN0SUQiOiJFU1RIIFN5c3RlbSBBY2NvdW50IiwiU3ViamVjdE9yZ2FuaXphdGlvbiI6IkVwc29tIGFuZCBTdCBIZWxpZXIgTkhTIFRydXN0IiwiU3ViamVjdE9yZ2FuaXphdGlvbklEI
joiMS4yLjMuNCIsIlN1YmplY3RSb2xlIjoiMi4xNi44NDAuMS4xMTM4ODMuMi4xLjMuNDYuMi4xLjEuMi4xLjIuNyIsIlB1cnBvc2VPZlVzZSI6IjIuMTYuODQwLjEuMTEzODgzLjIuMS4zLjQ2LjEuNS4xMDEifQ], accept-encoding=[gzip,deflate], cookie=[CacheBrowserId=XFs0ShTVVlvVwO7fWkq
Pag--], Content-Length=[29], Content-Type=[application/x-www-form-urlencoded; charset=UTF-8], user-agent=[Apache-HttpClient/4.5.1 (Java/1.8.0_91)], Host=[server1:8443]} response {X-Powered-By=[Undertow/1], Server=[WildFly/10]}}
It does not appear to like the fact that Mirth is sending charset in the content-type, but I have no way to stop Mirth doing this.

NB confirmed by adding charset=UTF-8 to postman.
Reply With Quote
  #12  
Old 04-16-2018, 10:42 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 832
siddharth is on a distinguished road
Default

hmm..Try calling the same thing using this below method. Use a JS writer, paste this function and pass that Base64 as a parameter to this function


Code:
function testGETClaims(jsonClaim) {
    
sURL='https://85.91.40.18:443/csp/healthshare/ldppatients/passthrough/EnsLib.REST.GenericService.cls?CfgItem=RestPassThrough'

    // Create url object
    url = new java.net.URL(sURL);
    data = '';
    
    data= encodeURIComponent(jsonClaim);

    conn = url.openConnection();

    //Set Headers
    conn.setDoOutput(true);
    conn.setDoInput(true);
    conn.setRequestMethod("POST");
    conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded");

    // Send request
    outStream = conn.getOutputStream();
    outWriter = new java.io.OutputStreamWriter(outStream);
    outWriter.write(data);
    outWriter.close();


    //Capture Response
    respCode = conn.getResponseCode();
    inputStream = conn.getInputStream();
    streamReader = new java.io.InputStreamReader(inputStream);
    respStream = new java.io.BufferedReader(streamReader);
    buffer = '';
    line = null;
    while ((line = respStream.readLine()) != null) {
        buffer = buffer + line;
    }
    respStream.close();
    return buffer;
}
You might have to tweak a little bit, but I believe this should work.

On related note, Are you getting 403 in response ?
__________________
HL7v2.7 Certified Control Specialist!

Last edited by siddharth; 04-16-2018 at 10:44 AM. Reason: foo
Reply With Quote
  #13  
Old 04-16-2018, 12:09 PM
seaston seaston is offline
OBX.3 Kenobi
 
Join Date: Feb 2010
Location: London, UK
Posts: 168
seaston is on a distinguished road
Default

I'm having a problem getting that to work at the moment because I think I need to disable hostname verification.

Code:
Wrapped javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present
	at 521d9d29-038a-4914-b3e3-6c74f0dcd9d7:429 (testGETClaims)
The response I get is a 500
Reply With Quote
  #14  
Old 04-17-2018, 01:51 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 832
siddharth is on a distinguished road
Default

This one above is a certificate error, the remote server has denied your request because It wants the certificate for verification.

I would suggest you to join the Mirth slack channel for real time assistance.
__________________
HL7v2.7 Certified Control Specialist!
Reply With Quote
  #15  
Old 04-21-2018, 05:09 AM
seaston seaston is offline
OBX.3 Kenobi
 
Join Date: Feb 2010
Location: London, UK
Posts: 168
seaston is on a distinguished road
Default

This is basically the same problem:

http://www.mirthproject.org/communit...d.php?t=216877

Work around is to add the content type to a channel map variable:

Code:
channelMap.put('contentType','application/x-www-form-urlencoded');
and put this in the Content Type in the destination then set data type to Binary and set Content to be ${message.encodedData}
Reply With Quote
Reply

Tags
jwt, querystring, sts, urlencoded

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 11:29 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation