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

JAYAPRIYA ATHEESAN jayapriya.atheesan at gmail.com
Fri Apr 29 08:17:01 EDT 2016


I have set the web origin, even then it is not going through.

'http://ds412.projectstatus.co.uk

 



 

 

Thanks,

Jayapriya Atheesan

 

From: Marek Posolda [mailto:mposolda at redhat.com] 
Sent: Friday, April 29, 2016 5:42 PM
To: JAYAPRIYA ATHEESAN; keycloak-user at lists.jboss.org
Subject: Re: [keycloak-user] Problem in getting access token from facebook
identity provider

 

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/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

 






_______________________________________________
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/6bce39a6/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 2589 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/keycloak-user/attachments/20160429/6bce39a6/attachment-0001.png 


More information about the keycloak-user mailing list