Using SSL authentication

The Secure Sockets Layer, commonly referred to as SSL, is another method of authentication based on externally stored credentials. The mechanism is very similar to that used in authentication based on external stores. The major difference is that in authentication based on external stores, we are still using passwords, and the normal user authentication is unaltered. In SSL-based authentication, users are defined externally or globally, and authorization is based on certificates.

Getting ready

In this recipe we will re-use the SSL-based connection setup that was described in Chapter 2, Securing the Network and Data in Transit. Additionally we will create a user named ssluser defined with an external identification. Before starting with the steps, set up the SSL communication as instructed in Chapter 2, Securing the Network and Data in Transit.

How to do it...

  1. Edit $ORACLE_HOME/network/admin/sqlnet.ora and set SSL_CLIENT_AUTHENTICATION to TRUE, as follows:
    SSL_CLIENT_AUTHENTICATION = TRUE
    
  2. Include TCPS if it is used as the authentication method in SQLNET.AUTHENTICATION_SERVICES, as follows:
    SQLNET.AUTHENTICATION_SERVICES = (BEQ, TCPS)
    
  3. Repeat steps 2 and 3 on the client host.
  4. On the server host, bounce the listener.
  5. Connect as the user system and create the user ssluser that is identified externally, as follows:
    SQL> create user ssluser identified externally as 'CN=PacktPub_C,C=GB';
    
    User created.
    

    Note

    Make sure to create the user identified by a distinguished name, that is defined in the certificate created and signed on the client side.

  6. Grant the create session privilege to the user ssluser, as follows:
    SQL> grant create session to ssluser;
    
    Grant succeeded.
    
  7. From the client side, authenticate the user without the password, as follows:
    SQL> conn /@hackdb_ssl
    Connected 
    

How it works...

The SSL authentication method relies on the client certificate, stored in wallets at the client side and server side, and is managed independently by the conventional Oracle authentication method.

There's more...

In practice, this authentication mode is like using password stores, since it may also help to hide connection credentials by excluding them from scripts and application code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.15.161