CredentialOption
  public
  
  final
  
  class
  CredentialOption
  
    extends Object
  
  
  
  
  
      implements
      
        Parcelable
      
  
  
| java.lang.Object | |
| ↳ | android.credentials.CredentialOption | 
Information about a specific type of credential to be requested during a CredentialManager.getCredential(Context, GetCredentialRequest, CancellationSignal, Executor, OutcomeReceiver) operation.
Summary
| Nested classes | |
|---|---|
| 
        
        
        
        
        class | CredentialOption.BuilderA builder for  | 
| Constants | |
|---|---|
| String | SUPPORTED_ELEMENT_KEYSBundle key to the list of elements keys supported/requested. | 
| Inherited constants | 
|---|
| Fields | |
|---|---|
| 
    public
    static
    final
    Creator<CredentialOption> | CREATOR
 | 
| Public methods | |
|---|---|
| 
        
        
        
        
        
        int | 
      describeContents()
      Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. | 
| 
        
        
        
        
        
        Set<ComponentName> | 
      getAllowedProviders()
      Returns the set of  | 
| 
        
        
        
        
        
        Bundle | 
      getCandidateQueryData()
      Returns the partial request data that will be sent to the provider during the initial credential candidate query stage. | 
| 
        
        
        
        
        
        Bundle | 
      getCredentialRetrievalData()
      Returns the full request data. | 
| 
        
        
        
        
        
        String | 
      getType()
      Returns the requested credential type. | 
| 
        
        
        
        
        
        boolean | 
      isSystemProviderRequired()
      Returns true if the request must only be fulfilled by a system provider, and false otherwise. | 
| 
        
        
        
        
        
        String | 
      toString()
      Returns a string representation of the object. | 
| 
        
        
        
        
        
        void | 
      writeToParcel(Parcel dest, int flags)
      Flatten this object in to a Parcel. | 
| Inherited methods | |
|---|---|
Constants
SUPPORTED_ELEMENT_KEYS
public static final String SUPPORTED_ELEMENT_KEYS
Bundle key to the list of elements keys supported/requested. Framework will use this key to determine which types of Credentials will utilize Credential Registry when filtering Credential Providers to ping.
Constant Value: "android.credentials.GetCredentialOption.SUPPORTED_ELEMENT_KEYS"
Fields
Public methods
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
 instance's marshaled representation. For example, if the object will
 include a file descriptor in the output of writeToParcel(android.os.Parcel, int),
 the return value of this method must include the
 CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
| int | a bitmask indicating the set of special object types marshaled
 by this Parcelable object instance.
 Value is either 0orCONTENTS_FILE_DESCRIPTOR | 
getAllowedProviders
public Set<ComponentName> getAllowedProviders ()
Returns the set of ComponentName corresponding to providers that must receive
 this option.
| Returns | |
|---|---|
| Set<ComponentName> | This value cannot be null. | 
getCandidateQueryData
public Bundle getCandidateQueryData ()
Returns the partial request data that will be sent to the provider during the initial
 credential candidate query stage.
 For security reason, a provider will receive the request data in two stages. First it gets
 this partial request that do not contain sensitive user information; it uses this
 information to provide credential candidates that the [@code CredentialManager] will show to
 the user. Next, the full request data, getCredentialRetrievalData(), will be sent to
 a provider only if the user further grants the consent by choosing a candidate from the
 provider.
| Returns | |
|---|---|
| Bundle | This value cannot be null. | 
getCredentialRetrievalData
public Bundle getCredentialRetrievalData ()
Returns the full request data.
| Returns | |
|---|---|
| Bundle | This value cannot be null. | 
getType
public String getType ()
Returns the requested credential type.
| Returns | |
|---|---|
| String | This value cannot be null. | 
isSystemProviderRequired
public boolean isSystemProviderRequired ()
Returns true if the request must only be fulfilled by a system provider, and false otherwise.
| Returns | |
|---|---|
| boolean | |
toString
public String toString ()
Returns a string representation of the object.
| Returns | |
|---|---|
| String | a string representation of the object. | 
writeToParcel
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
| dest | Parcel: This value cannot benull. | 
| flags | int: Additional flags about how the object should be written.
 May be 0 orParcelable.PARCELABLE_WRITE_RETURN_VALUE.
 Value is either0or a combination ofParcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES | 
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
