[prev in list] [next in list] [prev in thread] [next in thread] 

List:       forgerock-openidm
Subject:    Re: [OpenIDM] CORS problem - response header missing
From:       Jake Feasel <jake.feasel () forgerock ! com>
Date:       2015-09-22 16:17:17
Message-ID: CALXz=-VuRzyDffOhCtM7EgwF2U8ytF_nJKf5xE_o5B988MO8WQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


https://bugster.forgerock.org/jira/browse/OPENIDM-2454

Fixed on nightly builds, will be part of OpenIDM 4.0.

On Tue, Sep 22, 2015 at 7:42 AM, <jakob.fink@accenture.com> wrote:

> It's an open bug
>
>
>
> *From:* openidm-bounces@forgerock.org [mailto:
> openidm-bounces@forgerock.org] *On Behalf Of *MIRZAIAN Vincent
> *Sent:* den 22 september 2015 14:15
> *To:* openidm@forgerock.org
> *Subject:* [OpenIDM] CORS problem - response header missing
>
>
>
> Hello,
>
>
>
> I have an application which is calling a custom OpenIDM endpoint using
> CORS.
>
> This custom endpoint is returning a message with a status code as follow :
>
>
>
> throw {
>
>   "code": 400,
>
>   "message": "My custom error message"
>
> }
>
>
>
> The response sent to my application does not contain the
> "Access-Control-Allow-Origin" header therefore the browser thinks that the
> CORS request failed. My configuration inside the
> servlet-cors.json seems correct as the preflight request succeeds.
>
>
>
> Instead of the "throw" keyword, if I use the "return" keyword (return {
> "code" : .... }) , the reponse contains the "Access-Control-Allow-Origin"
> header but the status code is not correct (always 200).
>
>
>
> Is it a bug or am I missing some configuration ?
>
>
>
> Any help will be greatly appreciated.
>
>
>
>
> *Vincent MIRZAIAN *Consultant
> Fixe : +33 (0)1 49 03 87 84
> Mobile : +33 (0)6 80 90 51 35
> vincent.mirzaian@solucom.fr
> solucom
> Tour Franklin : 100 - 101 terrasse Boieldieu
> 92042 Paris La Défense Cedex
>
> ------------------------------
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise confidential information. If you have
> received it in error, please notify the sender immediately and delete the
> original. Any other use of the e-mail by you is prohibited. Where allowed
> by local law, electronic communications with Accenture and its affiliates,
> including e-mail and instant messaging (including content), may be scanned
> by our systems for the purposes of information security and assessment of
> internal compliance with Accenture policy.
>
> ______________________________________________________________________________________
>
> www.accenture.com
>
> _______________________________________________
> OpenIDM mailing list
> OpenIDM@forgerock.org
> https://lists.forgerock.org/mailman/listinfo/openidm
>
>


-- 
[image: ForgeRock] <http://www.forgerock.com/>*Jake Feasel*
Senior Software Developer  |  ForgeRock
*email* jake.feasel@forgerock.com <firstname.lastname@forgerock.com>
*web* forgerock.o <http://www.forgerock.com/>rg

[Attachment #5 (text/html)]

<div dir="ltr"><a href="https://bugster.forgerock.org/jira/browse/OPENIDM-2454">https: \
//bugster.forgerock.org/jira/browse/OPENIDM-2454</a><br><div><br></div><div>Fixed on \
nightly builds, will be part of OpenIDM 4.0.</div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 22, 2015 at 7:42 AM,  \
<span dir="ltr">&lt;<a href="mailto:jakob.fink@accenture.com" \
target="_blank">jakob.fink@accenture.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">





<div lang="SV" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">It's \
an open bug<u></u><u></u></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> \
<u></u></span></p> <div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span \
lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> \
<a href="mailto:openidm-bounces@forgerock.org" \
target="_blank">openidm-bounces@forgerock.org</a> [mailto:<a \
href="mailto:openidm-bounces@forgerock.org" \
target="_blank">openidm-bounces@forgerock.org</a>] <b>On Behalf Of </b>MIRZAIAN \
Vincent<br> <b>Sent:</b> den 22 september 2015 14:15<br>
<b>To:</b> <a href="mailto:openidm@forgerock.org" \
target="_blank">openidm@forgerock.org</a><br> <b>Subject:</b> [OpenIDM] CORS problem \
- response header missing<u></u><u></u></span></p> </div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u>  <u></u></p>
<div>
<p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Hello,<u></u><u></u></span></p>
 <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><u></u>  \
<u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">I have an \
application which is calling a custom OpenIDM  endpoint using \
CORS.<u></u><u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">This  \
custom endpoint is returning a message with a status code as follow \
:<u></u><u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><u></u>  \
<u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">throw \
{<u></u><u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">   \
&quot;code&quot;: 400,<u></u><u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">   \
&quot;message&quot;: &quot;My custom error message&quot;<u></u><u></u></span></p> <p \
style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">}<u></u><u></u></span></p>
 <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><u></u>  \
<u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">The \
response sent to my application does not contain the \
&quot;Access-Control-Allow-Origin&quot; header therefore the browser thinks that the \
CORS request failed.  My configuration  inside the servlet-cors.json  seems  correct \
as the preflight request succeeds.<u></u><u></u></span></p> <p \
style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><u></u>  \
<u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Instead of \
the &quot;throw&quot; keyword, if I use the &quot;return&quot; keyword (return { \
&quot;code&quot; : .... })  , the reponse contains  the \
&quot;Access-Control-Allow-Origin&quot; header but the status  code is not correct \
(always 200).<u></u><u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><u></u>  \
<u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Is it a \
bug or am I missing some configuration ?<u></u><u></u></span></p> <p \
style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><u></u>  \
<u></u></span></p> <p style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Any help \
will be greatly appreciated.<u></u><u></u></span></p> <p \
style="background:white"><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><u></u>  \
<u></u></span></p> <div>
<div name="divtagdefaultwrapper">
<p class="MsoNormal" style="background:white"><b><span \
style="font-size:8.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:navy">Vincent \
MIRZAIAN<br> </span></b><span \
style="font-size:8.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#5f5f5f">Consultant<br>
 Fixe : <a href="tel:%2B33%20%280%291%2049%2003%2087%2084" value="+33149038784" \
target="_blank">+33 (0)1 49 03 87 84</a><br> Mobile : <a \
href="tel:%2B33%20%280%296%2080%2090%2051%2035" value="+33680905135" \
target="_blank">+33 (0)6 80 90 51 35</a><br> <a \
href="mailto:vincent.mirzaian@solucom.fr" \
target="_blank">vincent.mirzaian@solucom.fr</a><br> </span><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:navy">solucom<br>
 </span><span style="font-size:8.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#5f5f5f">Tour \
Franklin : 100 - 101 terrasse Boieldieu <br>
92042 Paris La Défense Cedex</span><span \
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><u></u><u></u></span></p>
 </div>
</div>
</div>
</div></div></div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
This message is for the designated recipient only and may contain privileged, \
proprietary, or otherwise confidential information. If you have received it in error, \
please notify the sender immediately and delete the original. Any other use of the \
e-mail by  you is prohibited. Where allowed by local law, electronic communications \
with Accenture and its affiliates, including e-mail and instant messaging (including \
content), may be scanned by our systems for the purposes of information security and \
assessment of  internal compliance with Accenture policy. <br>
______________________________________________________________________________________<br>
 <br>
<a href="http://www.accenture.com" target="_blank">www.accenture.com</a><br>
</font>
</div>

<br>_______________________________________________<br>
OpenIDM mailing list<br>
<a href="mailto:OpenIDM@forgerock.org">OpenIDM@forgerock.org</a><br>
<a href="https://lists.forgerock.org/mailman/listinfo/openidm" rel="noreferrer" \
target="_blank">https://lists.forgerock.org/mailman/listinfo/openidm</a><br> \
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature"><div dir="ltr"><table border="0" cellspacing="0" \
cellpadding="0" style="font-family:Times"><tbody><tr><td valign="top"><a \
href="http://www.forgerock.com/" target="_blank"><img \
src="http://www.cyphondesign.com/clients/forgerock/signature/images/FR_Sig_Logo.png" \
width="185" height="70" border="0" alt="ForgeRock"></a></td><td valign="top" \
align="left" bgcolor="#ffffff" \
style="font-family:arial,helvetica,verdana,sans-serif;font-size:11px;color:rgb(47,52,56);line-height:18.1499996185303px"><strong>Jake \
Feasel</strong><br>Senior Software Developer   |   ForgeRock<br><span \
style="color:rgb(127,183,170)"><strong>email</strong></span>  <a \
href="mailto:firstname.lastname@forgerock.com" \
style="text-decoration:none;color:rgb(47,52,56)" \
target="_blank">jake.feasel@forgerock.com</a><br><span \
style="color:rgb(127,183,170)"><strong>web</strong></span>  <a \
href="http://www.forgerock.com/" style="text-decoration:none;color:rgb(47,52,56)" \
target="_blank">forgerock.o</a>rg</td></tr></tbody></table></div></div> </div>



_______________________________________________
OpenIDM mailing list
OpenIDM@forgerock.org
https://lists.forgerock.org/mailman/listinfo/openidm


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic