# ProviderSignInMethod

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/signin/ProviderSignInMethod.java+class:androidx.car.app.model.signin.ProviderSignInMethod) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/car/app/model/signin/ProviderSignInMethod "View this page in Java")


```
@RequiresCarApi(value = 2)
@CarProtocol
class ProviderSignInMethod : SignInTemplate.SignInMethod
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/SignInTemplate.SignInMethod` that allows the user to initiate sign-in with a authentication provider.

Not all providers will be available on all devices. It is the developer's responsibility to verify the presence of the corresponding provider by using the provider's own APIs. For example, for Google Sign In, check [Integrating Google Sign-In into Your Android App](https://developers.google.com/identity/sign-in/android/sign-in)).

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/ProviderSignInMethod#ProviderSignInMethod(androidx.car.app.model.Action)(action: https://developer.android.com/reference/kotlin/androidx/car/app/model/Action)` Creates a `https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/ProviderSignInMethod` instance with the given provider `https://developer.android.com/reference/kotlin/androidx/car/app/model/Action`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/ProviderSignInMethod#equals(java.lang.Object)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Action` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/ProviderSignInMethod#getAction()()` Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/Action` the user can use to initiate the sign-in with a given provider. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/ProviderSignInMethod#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/ProviderSignInMethod#toString()()` |

## Public constructors

### ProviderSignInMethod

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

```
ProviderSignInMethod(action: Action)
```

Creates a `https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/ProviderSignInMethod` instance with the given provider `https://developer.android.com/reference/kotlin/androidx/car/app/model/Action`.

#### Requirements

The provider action must not be a standard action, and it must use a `https://developer.android.com/reference/kotlin/androidx/car/app/model/ParkedOnlyOnClickListener`.

The action's title color can be customized with `https://developer.android.com/reference/kotlin/androidx/car/app/model/ForegroundCarColorSpan` instances, any other spans will be ignored by the host.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `action` does not meet the requirements |
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `action` is `null` |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Action` |   |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/ParkedOnlyOnClickListener` |   |

## Public functions

### equals

```
fun equals(other: Any!): Boolean
```

### getAction

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
fun getAction(): Action
```

Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/Action` the user can use to initiate the sign-in with a given provider.

### hashCode

```
fun hashCode(): Int
```

### toString

```
fun toString(): String
```