Created
November 4, 2013 08:30
-
-
Save gpr/7299707 to your computer and use it in GitHub Desktop.
How to get email from X509 certificate used for client authentication. The email could be used for setting the current user in Devise or Omniauth (considering that the user has been authenticated) Common name could be used instead of email by using SSL_CLIENT_S_DN_CN. request.env["SSL_CLIENT_S_DN_Email"] could be used by enabling +StdEnvVars but…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_ssl_username | |
request.env["REMOTE_USER"] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SSLVerifyClient require | |
SSLVerifyDepth 2 | |
<Directory /var/www/html/app1> | |
RailsEnv development | |
Options -MultiViews | |
SSLOptions -StdEnvVars -ExportCertData | |
SSLUserName SSL_CLIENT_S_DN_Email | |
</Directory> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment