• Resolved sinho0689

    (@sinho0689)


    After installing and activating the cors extension in the chrome browser, restapi is being authenticated using the apikey method.
    However, in the browser, when the get method is called, the options method is automatically called.
    But 401 unauthorized processing in the options request.
    On the other hand, it works fine with using curl.

    Why can’t authentication process in options request?

    this is my .htaccess file

    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP:Authorization} ^(.*)
    RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
    
    RewriteCond %{REQUEST_METHOD} OPTIONS
    RewriteRule ^(.*)$ $1 [R=200,L]
    
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    </IfModule>
    

    Even when I disable this plugin
    An options request also occurs, but it works.
    I have all the cors settings done.

    My guess is that this plugin is not able to process authentication on options request.

    How to fix it? my .htaccess value correct?

    • This topic was modified 4 years, 6 months ago by sinho0689.
Viewing 1 replies (of 1 total)
  • Plugin Author miniOrange

    (@cyberlord92)

    Thank you for reaching out to us.

    Can you please share with us the request format you are using? Which APIs are you trying to protect with API key Authentication method?

    Also, Can you please send us a support query from the contact form inside the plugin so that we can help you to setup the plugin in no time.

Viewing 1 replies (of 1 total)
  • The topic ‘OPTIONS Request Method Unauthorized 401’ is closed to new replies.