[keycloak-user] Problem in getting access token from facebook identity provider

Marek Posolda mposolda at redhat.com
Fri Apr 29 08:12:15 EDT 2016


Do you have "Web origins" set for your client? You can set in keycloak 
admin console.

Marek

On 29/04/16 12:46, JAYAPRIYA ATHEESAN wrote:
>
> Hi All,
>
> I’m facing issue in getting access token from facebook identity provider.
>
> This is the code I’m using for fetching the access token, but the 
> method doesn’t succeed.
>
> $http.get('/auth/realms/facebook-identity-provider-realm/broker/facebook/token').success(function(data) 
> {
>
>             var accessTokenParameter = 'access_token=';
>
>             var accessToken = 
> data.substring(data.indexOf(accessTokenParameter) + 
> accessTokenParameter.length, data.indexOf('&'));
>
> $http.get('https://graph.facebook.com/me?access_token=' + accessToken)
>
>                 .success(function(profile) {
>
>                     $scope.socialProfile = profile;
>
>                 })
>
>                 .error(function(data, status, headers, config) {
>
>                     $scope.socialProfile = 'Could not obtain social 
> profile. Trying to refresh your token.';
>
>                     Auth.refreshToken();
>
>                 });
>
>         });
>
> Below is the exception I’m facing.
>
> XMLHttpRequest cannot load 
> https://<host_name>:8444/auth/realms/giggzo/broker/facebook/token. No 
> 'Access-Control-Allow-Origin' header is present on the requested 
> resource. Origin 'http://ds412.projectstatus.co.uk' is therefore not 
> allowed access. The response had HTTP status code 400.
>
> PLEASE HELP ME IN RESOLVING THE ISSUE.
>
> Thanks,
>
> Jayapriya Atheesan
>
>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160429/ad292fc0/attachment.html 


More information about the keycloak-user mailing list