SSL client cert authentication for only some URLs?

2019-07-19 08:31发布

If I authenticate my clients using SSL client certs, is that necessarily a site-wide filter, or can I either require or not require authentication per-URL from within an application? So I'd like

https://mysite.com/my_url doesn't care who the client is, just uses 'normal' https https://mysite.com/my_sensitive_url requires that the client is using a valid client cert

I'm working in Ruby on Rails, but I'm interested in the general question of whether SSL client cert authentication is flexible enough for this. I can imagine that a hand-written apache conf with different settings for different URLs could probably do it, but I'd really much rather define this kind of thing at the application level.

1条回答
Evening l夕情丶
2楼-- · 2019-07-19 09:20

You would (a) set the server to do authentication via SSL certificates; (b) set the server to to 'want' rather than 'need' SSL client authentication, and then (c) define access rules for the specific URLs or patterns that required the user to be logged in, and not for the others.

查看更多
登录 后发表回答