oracle.jcr

## Interface CredentialsProvider

All Superinterfaces:
  javax.naming.Referenceable, java.io.Serializable

    public interface CredentialsProvider
    extends java.io.Serializable, javax.naming.Referenceable

A CredentialsProvider generates a Credentials object when no Credentials object is supplied to the `login` method of Repository.

JCR allows the Repository `login` method to be called without Credentials (`login()` and `login(String)`) or with null Credentials (`login(Credentials)` and `login(Credentials, String)`).

The Oracle JCR framework allows a CredentialsProvider to be registered with a Repository. The CredentialsProvider method `getCredentials` is called by the JCR framework when no Credentials are supplied to the `login` method. The Credentials returned by this method are used to authenticate and create a JCR session, no differently than if Credentials were supplied to `login`.

### Method Summary

All Methods Instance Methods Abstract Methods
`Credentials` `getCredentials(Repository repository, java.lang.String workspaceName)` Gets credentials used to create a JCR session when no credentials are supplied to the `login` method of Repository.

### Methods inherited from interface javax.naming.Referenceable

`getReference`

### Method Detail

#### getCredentials

    Credentials getCredentials(Repository repository,
                               java.lang.String workspaceName)
                        throws java.lang.Exception

Gets credentials used to create a JCR session when no credentials are supplied to the `login` method of Repository.

Parameters:
  `repository` - the repository; required
  `workspaceName` - the workspace, or null for the "default" workspace
Returns:
  the Credentials, or null if unable to generate Credentials
Throws:
  `java.lang.Exception` - if the operation fails

Copyright © 2003, 2018, Oracle and/or its affiliates. All rights reserved.