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

JAYAPRIYA ATHEESAN jayapriya.atheesan at gmail.com
Fri Apr 29 06:46:08 EDT 2016


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/tok
en').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

 

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


More information about the keycloak-user mailing list