<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Do you have "Web origins" set for your
client? You can set in keycloak admin console.<br>
<br>
Marek<br>
<br>
On 29/04/16 12:46, JAYAPRIYA ATHEESAN wrote:<br>
</div>
<blockquote cite="mid:57233b76.842f620a.2c36.7523@mx.google.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m facing issue in getting access token
from facebook identity provider.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This is the code I’m using for fetching the
access token, but the method doesn’t succeed.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">$http.get('/auth/realms/facebook-identity-provider-realm/broker/facebook/token').success(function(data)
{<o:p></o:p></p>
<p class="MsoNormal"> var accessTokenParameter =
'access_token=';<o:p></o:p></p>
<p class="MsoNormal"> var accessToken =
data.substring(data.indexOf(accessTokenParameter) +
accessTokenParameter.length, data.indexOf('&'));<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">
$http.get('<a class="moz-txt-link-freetext" href="https://graph.facebook.com/me?access_token=">https://graph.facebook.com/me?access_token=</a>' +
accessToken)<o:p></o:p></p>
<p class="MsoNormal"> .success(function(profile)
{<o:p></o:p></p>
<p class="MsoNormal"> $scope.socialProfile =
profile;<o:p></o:p></p>
<p class="MsoNormal"> })<o:p></o:p></p>
<p class="MsoNormal"> .error(function(data,
status, headers, config) {<o:p></o:p></p>
<p class="MsoNormal"> $scope.socialProfile =
'Could not obtain social profile. Trying to refresh your
token.';<o:p></o:p></p>
<p class="MsoNormal"> Auth.refreshToken();<o:p></o:p></p>
<p class="MsoNormal"> });<o:p></o:p></p>
<p class="MsoNormal"> });<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Below is the exception I’m facing.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">XMLHttpRequest cannot load
<a class="moz-txt-link-freetext" href="https://">https://</a><host_name>:8444/auth/realms/giggzo/broker/facebook/token.
No 'Access-Control-Allow-Origin' header is present on the
requested resource. Origin '<a class="moz-txt-link-freetext" href="http://ds412.projectstatus.co.uk">http://ds412.projectstatus.co.uk</a>'
is therefore not allowed access. The response had HTTP status
code 400.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">PLEASE HELP ME IN RESOLVING THE ISSUE.<o:p></o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Jayapriya
Atheesan</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
</blockquote>
<br>
</body>
</html>