microg/GmsCore · error · TokenBinding.UnsupportedTokenBindingStatusException
TokenBindingStatus ${str} not supported
Error message
TokenBindingStatus ${str} not supported What it means
TokenBinding.TokenBindingStatus.fromString() maps a token-binding status string ("supported" or "present") to the enum. Unknown strings throw UnsupportedTokenBindingStatusException. It's invoked from createFromParcel during unparceling of objects containing a TokenBinding, so it can also surface as a RuntimeException during Parcel deserialization.
Source
Thrown at play-services-fido/src/main/java/com/google/android/gms/fido/fido2/api/common/TokenBinding.java:154
SUPPORTED("supported"),
/**
* The client does not support token binding.
*/
NOT_SUPPORTED("not-supported");
@NonNull
private final String value;
TokenBindingStatus(@NonNull String value) {
this.value = value;
}
@Hide
public static TokenBindingStatus fromString(String str) throws UnsupportedTokenBindingStatusException {
for (TokenBindingStatus value : values()) {
if (value.value.equals(str)) return value;
}
throw new UnsupportedTokenBindingStatusException("TokenBindingStatus " + str + " not supported");
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(value);
}
@Override
public int describeContents() {
return 0;
}
public static final Creator<TokenBindingStatus> CREATOR = new Creator<TokenBindingStatus>() {
@Override
public TokenBindingStatus createFromParcel(Parcel in) {
try {
return fromString(in.readString());
} catch (UnsupportedTokenBindingStatusException e) {View on GitHub (pinned to 157c9d86ac)
Solutions
- Use exactly "supported" or "present" for the status string.
- Prefer TokenBindingStatus enum constants over raw strings when constructing TokenBinding.
- Wrap createFromParcel/fromString in try-catch for UnsupportedTokenBindingStatusException and default to null (token binding omitted) when unknown.
Example fix
// before
TokenBinding tb = TokenBinding.TokenBindingStatus.fromString("not-supported");
// after
TokenBinding tb;
try {
tb = TokenBinding.TokenBindingStatus.fromString(status);
} catch (UnsupportedTokenBindingStatusException e) {
tb = null;
} Defensive patterns
Strategy: try-catch
Validate before calling
boolean valid = "supported".equals(status) || "present".equals(status);
Try / catch
try { status = TokenBinding.TokenBindingStatus.fromString(s); } catch (UnsupportedTokenBindingStatusException e) { status = null; /* token binding omitted */ } Prevention
- Restrict status strings to "supported" and "present".
- Treat token binding as optional — null out unknown statuses instead of failing the whole credential.
- Test Parcel round-trips if you construct TokenBinding objects manually.
When it happens
Trigger: Calling fromString with a status other than "supported"/"present" (e.g. "not-supported", "", null), or parceling a TokenBinding whose status was written from an unrecognized string and later unparceled via createFromParcel.
Common situations: Server-side JSON carrying a tokenBinding status from a different WebAuthn revision; hand-built TokenBinding objects with typo'd statuses that blow up later at parcel-unmarshal time rather than at construction.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Transport ${transport} not supported
- Attachment ${attachment} not supported
- Attestation conveyance preference ${attachment} not supporte
- PublicKeyCredentialType ${type} not supported
- User verification requirement ${attachment} not supported
AI-assisted analysis of microg/GmsCore@157c9d86ac (2026-09-06).
Data as JSON: /api/errors/d77ed0a43c9f18db.
Report an issue: GitHub.