Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Configuration HWIOAuthBundle pour l'Emploi Store
# Un exemple de mise en place de HWIOAuthBundle, à adapter selon votre contexte
# Dans votre composer.json, ajouter :
“require” : {
"hwi/oauth-bundle": "0.4.*@dev"
}
# Mettre à jour vos bundles.
# Modifier le fichier app/AppKernel.php
public function registerBundles()
{
$bundles = array(
...
new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
);
...
}
# Dans le fichier app/config/config.yml, ajouter :
hwi_oauth:
# name of the firewall in which this bundle is active, this setting MUST be set
firewall_name: secured_area
resource_owners:
openam:
type: oauth2
client_id: myClientID
client_secret: password
access_token_url: https://www.emploi-store.fr/identite/oauth2/access_token?realm=test
authorization_url: https://www.emploi-store.fr/identite/oauth2/authorize?realm=test
infos_url: https://www.emploi-store.fr/identite/oauth2/userinfo?realm=test
scope: "email openid profile"
paths:
identifier: sub
nickname: sub
realname: name
email: email
# Dans le fichier app/config/security.yml, ajouter :
security:
firewalls:
secured_area:
anonymous: ~
oauth:
resource_owners:
openam: "/login/check-openam"
login_path: /login
use_forward: false
failure_path: /login
oauth_user_provider:
service: hwi_oauth.user.provider
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
providers:
hwi:
id: hwi_oauth.user.provider
# Dans fichier app/config/routing.yml, ajouter :
hwi_oauth_redirect:
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
prefix: /connect
hwi_oauth_login:
resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
prefix: /login
openam_login:
pattern: /login/check-openam
# Démarrer l’app et accéder à la page http://localhost:8000/login
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.