1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

I am encountering an issue with receiving a null value for the Postman bearer token in a...

Discussão em 'Outras Linguagens' iniciado por Mahesh, Novembro 8, 2024 às 06:32.

  1. Mahesh

    Mahesh Guest

    I am currently experiencing an issue with my Laravel API on a cPanel-hosted environment. When making API requests from Postman with a Bearer token in the Authorization header, the token is not being received by the application. This setup works as expected on my local environment, where the Bearer token is successfully passed and retrieved by the application. However, in the cPanel environment, the Authorization header appears to be missing or stripped out.

    I have already tried the following troubleshooting steps:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    </IfModule>

    <IfModule mod_headers.c>
    Header always set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Headers "Authorization, Content-Type, X-Requested-With"
    </IfModule>


    I am getting a null value when trying to retrieve the Bearer token using $request->bearerToken() in middleware.

    I am using cPanel for my hosting environment.

    Continue reading...

Compartilhe esta Página