Validate authentication cookie on another server

The goal is to integrate our existing project without a second login system.

Issues:

  • our frontend app needs to read information from the authentication token and the token coming from community server is encrypted
  • our backend uses jwt signature to validate tokens and the current authentication token is not a jwt.

I manage to find an elegant solution, I used /api/2.0/people/@self; as validation endpoint

  location @redirect_to_auth {
      return 302 /Auth.aspx?refererurl=$request_uri;
  }

  location /orders {
      auth_request /api/2.0/people/@self;
      error_page 401 = @redirect_to_auth;
      alias /var/www/custom/orders;
      try_files $uri $uri/ /index.html;
  }
1 Like

Hello @dsl400

We are glad to know that you’ve managed to find the solution yourself.

1 Like