---
updatedAt: 2025-04-23T20:29:38.000Z
agentTools:
  projectIndex: https://silhouette.readme.io/llms.txt
---

# OAuth1 based providers

To configure OAuth1 based providers you must use the `OAuth1Settings` class. This class has the following form:

```scala
case class OAuth1Settings(
  requestTokenURL: String,
  accessTokenURL: String,
  authorizationURL: String,
  callbackURL: String,
  apiURL: Option[String] = None,
  consumerKey: String,
  consumerSecret: String)
```

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Property
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `requestTokenURL`
      </td>

      <td>
        The request token URL provided by the OAuth provider
      </td>
    </tr>

    <tr>
      <td>
        `accessTokenURL`
      </td>

      <td>
        The access token URL provided by the OAuth provider
      </td>
    </tr>

    <tr>
      <td>
        `authorizationURL`
      </td>

      <td>
        The authorization URL provided by the OAuth provider
      </td>
    </tr>

    <tr>
      <td>
        `callbackURL`
      </td>

      <td>
        The callback URL to the application after a successful authentication on the OAuth provider. The URL can be a relative path which will be resolved against the current request's host
      </td>
    </tr>

    <tr>
      <td>
        `apiURL`
      </td>

      <td>
        The URL to fetch the profile from the API. Can be used to override the default URL hardcoded in every provider implementation.
      </td>
    </tr>

    <tr>
      <td>
        `consumerKey`
      </td>

      <td>
        The consumer ID provided by the OAuth provider
      </td>
    </tr>

    <tr>
      <td>
        `consumerSecret`
      </td>

      <td>
        The consumer secret provided by the OAuth provider
      </td>
    </tr>
  </tbody>
</Table>

## Callback URL

The `callbackURL` must point to your action which is responsible for\
the authentication over your defined providers. So if you define the\
following route as example:

```scala
GET  /authenticate/:provider  @controllers.SocialAuthController.authenticate(provider)
```

Then your `callbackURL` must have the following format:

```scala
callbackURL="https://your.domain.tld/authenticate/linkedin"
```

## Example

```scala
linkedin {
  requestTokenURL="https://api.linkedin.com/uas/oauth/requestToken"
  accessTokenURL="https://api.linkedin.com/uas/oauth/accessToken"
  authorizationURL="https://api.linkedin.com/uas/oauth/authenticate"
  callbackURL="https://your.domain.tld/authenticate/linkedin"
  consumerKey="your.consumer.key"
  consumerSecret="your.consumer.secret"
}

twitter {
  requestTokenURL="https://twitter.com/oauth/request_token"
  accessTokenURL="https://twitter.com/oauth/access_token"
  authorizationURL="https://twitter.com/oauth/authenticate"
  callbackURL="https://your.domain.tld/authenticate/twitter"
  consumerKey="your.consumer.key"
  consumerSecret="your.consumer.secret"
}

xing {
  requestTokenURL="https://api.xing.com/v1/request_token"
  accessTokenURL="https://api.xing.com/v1/access_token"
  authorizationURL="https://api.xing.com/v1/authorize"
  callbackURL="https://your.domain.tld/authenticate/xing"
  consumerKey="your.consumer.key"
  consumerSecret="your.consumer.secret"
}
```

To get the consumerKey/consumerSecret keys you need to log into the developer site of each service and register your application.

## Override the configuration locally

Basically the configuration of the providers will be done globally on provider instantiation. But in some circumstances it is necessary to override this globally configuration with other values. This can be done with the `withSettings` method that every `SocialProvider` has implemented. The `withSettings` methods accepts a function which gets the current configuration as parameter and which must return a new configuration.

```scala
provider.withSettings { config =>
  config.copy("new-value")
}.authenticate()
```