title: how to read a custom object from com.typesafe.config
body: <p>Referring to <code>com.typesafe.config</code> library, I notice that while there are methods available to parse a value to <code>Integer</code>, <code>Boolean</code> etc., there aren't methods available to parse a value as a custom object. Am I correct?</p>
  
  <p><a href="https://lightbend.github.io/config/latest/api/com/typesafe/config/Config.html" rel="nofollow noreferrer">https://lightbend.github.io/config/latest/api/com/typesafe/config/Config.html</a></p>
  
  <p>I want to create a config file with the following values</p>
  
  <pre><code>cookieName: String = "id",
    cookiePath  = "/",
    cookieDomain = None,
    secureCookie  = true,
    httpOnlyCookie = true,
    useFingerprinting = true,
    cookieMaxAge  = None,
    authenticatorIdleTimeout = None,
    authenticatorExpiry: = 12 hours
  </code></pre>
  
  <p>and parse it into a case class</p>
  
  <pre><code>case class CookieAuthenticatorSettings(
    cookieName: String ,
    cookiePath: String ,
    cookieDomain: Option[String] ,
    secureCookie: Boolean ,
    httpOnlyCookie: Boolean, 
    useFingerprinting: Boolean ,
    cookieMaxAge: Option[FiniteDuration] ,
    authenticatorIdleTimeout: Option[FiniteDuration] ,
    authenticatorExpiry: FiniteDuration 
  )
  </code></pre>
  
  <p>How could I do this? In the following snippet, I see that a method 'as' has been used but when I tried to use it in my code, the compiler couldn't find the 'as' method.</p>
  
  <pre><code>val config = configuration.underlying.as[JcaSignerSettings]("silhouette.oauth1TokenSecretProvider.signer")
  </code></pre>
  
  <p>The above code is from <a href="https://github.com/mohiva/play-silhouette-seed/blob/master/app/modules/SilhouetteModule.scala" rel="nofollow noreferrer">https://github.com/mohiva/play-silhouette-seed/blob/master/app/modules/SilhouetteModule.scala</a></p>