Fix broker packaging and facebook example

This commit is contained in:
mposolda 2015-03-17 10:09:14 +01:00
parent c650a8d52d
commit d3e75084de
5 changed files with 15 additions and 2 deletions

View file

@ -9,6 +9,7 @@
<dependencies>
<module name="org.keycloak.keycloak-core"/>
<module name="org.keycloak.keycloak-model-api"/>
<module name="javax.ws.rs.api"/>
</dependencies>
</module>

View file

@ -10,6 +10,10 @@
<module name="org.keycloak.keycloak-core"/>
<module name="org.keycloak.keycloak-model-api"/>
<module name="org.keycloak.keycloak-broker-core"/>
<module name="org.codehaus.jackson.jackson-core-asl"/>
<module name="org.codehaus.jackson.jackson-mapper-asl"/>
<module name="org.codehaus.jackson.jackson-xc"/>
<module name="javax.ws.rs.api"/>
</dependencies>
</module>

View file

@ -31,7 +31,9 @@ Make sure you've set up a application in Facebook
This example application requires you to create a Facebook Application. How to create it is beyond the scope of this
documentation.
Please take a look on [Facebook Developer Console](https://developers.facebook.com/apps/) for more details.
Please take a look on [Facebook Developer Console](https://developers.facebook.com/apps/) for more details. Make sure to use the correct
redirect URI to be used as URL on Facebook. The facebook will redirect to this URI after finish authentication. For this example, it's the URL
[http://localhost:8080/auth/realms/facebook-identity-provider-realm/broker/facebook](http://localhost:8080/auth/realms/facebook-identity-provider-realm/broker/facebook) .
Once you have a Facebook Application configured, you need to obtain both **App ID** and **App Secret** and update the
**facebook-identity-provider-realm.json** configuration file with these information. There you'll find a section as follows:

View file

@ -42,6 +42,12 @@
],
"webOrigins": [
"http://localhost:8080"
],
"identityProviders": [
{
"id": "facebook",
"retrieveToken": true
}
]
}
],

View file

@ -83,7 +83,7 @@ module.controller('GlobalCtrl', function($scope, $http, $location, Auth) {
$scope.identity = Auth.getIdentity();
$scope.loadSocialProfile = function() {
$http.get('http://localhost:8081/auth/realms/facebook-identity-provider-realm/broker/facebook/token').success(function(data) {
$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('&'));