org.modeshape.jcr.api

## Class ServletCredentials

- java.lang.Object
- - org.modeshape.jcr.api.ServletCredentials

- All Implemented Interfaces:
    Serializable, Credentials

      public class ServletCredentials
      extends Object
      implements Credentials

  A `Credentials` implementation that assumes servlet-based authentication and provides authorization through the `servlet role-checking mechanism`.

  These credentials are really only valid for the life of the `servlet request`, and thus should be used to obtain a Session for each request.

  Note that this class can only be used if the `HttpServletRequest` class is on the classpath.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServletCredentials(HttpServletRequest request)` Create a `Credentials` using the supplied `servlet information`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `HttpServletRequest` | `getRequest()` Get the Servlet request that this credentials applies to.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ServletCredentials

          public ServletCredentials(HttpServletRequest request)

      Create a `Credentials` using the supplied `servlet information`.
      Parameters:
        `request` - the servlet request

  - ### Method Detail

    - #### getRequest

          public HttpServletRequest getRequest()

      Get the Servlet request that this credentials applies to.
      Returns:
        the request, or null if this credentials is no longer valid

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.