Authentication par header est-il possible sur un mutualisé ?
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

Authentication par header est-il possible sur un mutualisé ?

by
Francois76
Created on 2020-11-22 18:06:05 in Hébergements Web

Il semblerait que la config par défaut d'Apache (CGIPassAuth) ne prenne pas en compte l'authentification par header sur un mutualisé. Quelqu'un peut-il me confirmer ?


2 Replies ( Latest reply on 2024-11-18 11:13:33 by
SamuelR17
)

Bon c'est bon j'ai trouvé, un petit fichier **.htaccess** avec la commande **CGIPassAuth On** et c'est good.

Si vous rencontrez des difficultés pour vous authentifier auprès du Webservice, veuillez lire les informations suivantes :

Le serveur Web peut avoir besoin que la CGIPassAuthdirective soit activée pour permettre à PrestaShop de recevoir l' HTTP_AUTHORIZATIONen-tête.



Vous pouvez l'activer dans votre .htaccess :

CGIPassAuth On

Ou, également en .htaccess, utilisez SetEnv: ( celle que j'utilise)

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1



sinon sur ce site une autre solution

Apache: Passing Authorization header to PHP’s $_SERVER[‘HTTP_AUTHORIZATION’] properly

https://community.ovhcloud.com/community/fr/authentication-par-header-est-il-possible-sur-un-mutualise?id=community_question&sys_id=d630b9489dda4e901e11a21128f2cf3b

Bonjour,

Je n'arrive pas à avoir Authorization dans mes headers pour mon token JWT.

Mon fichier .htaccess :

RewriteEngine On
CGIPassAuth On
RewriteBase /PIDWebProject_Angular_Frontend/
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /PIDWebProject_Angular_Frontend/index.html [L]


# Autoriser et capturer l'en-tête Authorization
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]

# Redirection HTTP vers HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

# Empêcher l'affichage de l'index des dossiers
Options -Indexes

Quelqu'un peut m'aider ?

Sam