Skip to content

sfkwan/nginx-cookie-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Background

  1. Use nginx to get access token from cookie. If avaliable, set Authorization: Bearer [access_token]
  2. Use ealen/echo-server to simulate the origin API server
  3. By convention, the origin API server DNS is origin-[api service]

Make use of nip as DNS server

  1. API service host name: prkwan.[local server ip].nip.io
  2. Origin API service host name: origin-prkwan.[local server ip].nip.io
  • For example: prkwan.192.168.20.147.nip.io

How to run

curl 'http://prkwan.192.168.20.147.nip.io:8888/api/prkwan?verify=cookie' \
-H 'Cookie: access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjIsInVzZXJuYW1lIjoibWFyaWEiLCJyb2xlcyI6WyJndWVzdCIsInVzZXIiXSwiaWF0IjoxNjkyMzUxNzU4LCJleHAiOjE2OTIzNTIwNTh9.GOqkLFIqKN2DGXpanBGKfbGfETnbM9ge3-FMltBLyhQ' | jq

sample

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages