Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
si:oauth2proxy [2021/02/21 16:57]
dino créée
si:oauth2proxy [2021/02/21 17:08] (Version actuelle)
dino
Ligne 1: Ligne 1:
-Installation de Oauth2 proxy+====== ​Installation de Oauth2 proxy ====== 
  
 <​code>​ <​code>​
Ligne 6: Ligne 7:
 tar xvfz oauth2-proxy-v7.0.1.linux-amd64.tar.gz tar xvfz oauth2-proxy-v7.0.1.linux-amd64.tar.gz
 ln -s /​opt/​oauth2-proxy-v7.0.1.linux-amd64 /​opt/​oauth2-proxy ln -s /​opt/​oauth2-proxy-v7.0.1.linux-amd64 /​opt/​oauth2-proxy
 +</​code>​
 +
 +création du fichier de conf dans /​opt/​keycloak.cfg
 <​code>​ <​code>​
 +provider = "​oidc"​
 +redirect_url = "​https://​transfert-images.parinux.org/​oauth2/​callback"​
 +oidc_issuer_url = "​https://​sso.parinux.org/​auth/​realms/​master"​
 +upstreams = [
 +    "​https://​transfert-images.parinux.org"​
 +]
 +email_domains = [
 +    "​*"​
 +]
 +client_id = "​IDKeycloakduclient"​
 +client_secret = "​secretdukeycloakpourceclient"​
 +pass_access_token = true
 +cookie_secret = "​uncookiede32caractéres"​
 +skip_provider_button = true
 +</​code>​
 +
 +
 +Tester votre fichier de conf
 +<​code>​
 +/​opt/​oauth2-proxy/​oauth2-proxy --config=/​opt/​keycloak.cfg
 +</​code>​
 +corriger les soucis
 +
 +====== création du service ======
 +
 +
 +Création du fichier /​etc/​systemd/​system/​oauth2-proxy.service
 +<​code>​
 +[Unit]
 +Description=oauth2-proxy daemon service
 +After=syslog.target network.target
 +
 +[Service]
 +User=www-data
 +Group=www-data
 +
 +ExecStart=/​opt/​oauth2-proxy/​oauth2-proxy --config=/​opt/​keycloak.cfg
 +ExecReload=/​bin/​kill -HUP $MAINPID
 +
 +KillMode=process
 +Restart=always
 +
 +[Install]
 +WantedBy=multi-user.target
 +
 +</​code>​
 +
 +si le reverse proxy n'est pas sur le même serveur il faut qu'il y ait :
 +<​code>​
 +ExecStart=/​opt/​oauth2-proxy/​oauth2-proxy --config=/​opt/​keycloak.cfg --http-address=0.0.0.0:​4180
 +</​code>​
 +
 +
 +le mettre en exécutable,​ permettre son lancement, son état et le lancer
 +<​code>​
 +chmod +x/​etc/​systemd/​system/​oauth2-proxy.service
 +systemctl enable oauth2-proxy.service
 +systemctl status oauth2-proxy.service
 +systemctl start oauth2-proxy.service
 +</​code>​
 +
 +
 +doc
 +
 +https://​oauth2-proxy.github.io/​oauth2-proxy/​docs/​configuration/​overview/#​config-file
 +
 +https://​devopsloggers.com/​2020/​05/​30/​oauth2_proxy-google-authentication-using-nginx-on-ubuntu-18-04/​
 +
 +
 
/var/lib/dokuwiki/data/attic/si/oauth2proxy.1613923022.txt.gz · Dernière modification: 2021/02/21 16:57 par dino
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Debian Driven by DokuWiki