Skip to content

Commit e298052

Browse files
author
Jonas Hendrickx
authored
Drop Facet ID instructions for Android SDK. Integration simplified. (#128)
1 parent 17b32d7 commit e298052

File tree

1 file changed

+3
-78
lines changed

1 file changed

+3
-78
lines changed

src/guide/frontend/android.md

Lines changed: 3 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ The Passwordless.dev Android client SDK gives users the ability to leverage thei
2222
<dependency>
2323
<groupId>com.bitwarden</groupId>
2424
<artifactId>passwordless-android</artifactId>
25-
<version>1.0.4</version>
25+
<version>1.1.0</version>
2626
</dependency>
2727
```
2828

2929
@tab Gradle Kotlin DSL
3030

3131
```kotlin
32-
implementation("com.bitwarden:passwordless-android:1.0.4")
32+
implementation("com.bitwarden:passwordless-android:1.1.0")
3333
```
3434

3535
@tab Gradle Groovy DSL
3636

3737
```groovy
38-
implementation 'com.bitwarden:passwordless-android:1.0.4'
38+
implementation 'com.bitwarden:passwordless-android:1.1.0'
3939
```
4040

4141
:::
@@ -62,9 +62,6 @@ data class PasswordlessOptions(
6262
// Identifier for your server, for example 'example.com' if your backend is hosted at https://example.com.
6363
val rpId: String,
6464

65-
// This is where your Facet ID goes
66-
val origin: String,
67-
6865
// Where your backend is hosted
6966
val backendUrl:String,
7067

@@ -92,78 +89,6 @@ In your application's `res/xml/assetlinks.xml`, you will then need to add the fo
9289
</resources>
9390
```
9491

95-
### Facet ID
96-
97-
The `Facet ID` will be used later in this guide as the `origin`.
98-
99-
To obtain the Facet ID continue the steps below, the Facet ID typically looks like:
100-
101-
`android:apk-key-hash:POIplOLeHuvl-XAQckH0DwY4Yb1ydnnKcmhn-jibZbk`
102-
103-
1. Execute the following command in your terminal:
104-
105-
::: tabs
106-
107-
@tab Bash MacOS
108-
109-
1. Install Homebrew
110-
2. Execute the following command:
111-
```sh
112-
brew install coreutils
113-
```
114-
3. Extract the SHA-256 hash:
115-
116-
```bash
117-
# Linux, Mac OS, Git Bash, ...
118-
keytool -list -v -keystore ~/.android/debug.keystore | grep "SHA256: " | cut -d " " -f 3 | xxd -r -p | basenc --base64url | sed 's/=//g'
119-
```
120-
121-
@tab Bash Ubuntu
122-
123-
1. Execute the following commands in your terminal to install any missing dependencies.
124-
```shell
125-
sudo apt-get update
126-
sudo apt-get install coreutils
127-
```
128-
2. Extract the SHA-256 hash:
129-
130-
```bash
131-
# Linux, Mac OS, Git Bash, ...
132-
keytool -list -v -keystore ~/.android/debug.keystore | grep "SHA256: " | cut -d " " -f 3 | xxd -r -p | basenc --base64url | sed 's/=//g'
133-
```
134-
135-
@tab Powershell
136-
137-
```powershell
138-
# Run keytool command and extract SHA256 hash
139-
$keytoolOutput = keytool -list -v -keystore $HOME\.android\debug.keystore
140-
$sha256Hash = ($keytoolOutput | Select-String "SHA256: ").ToString().Split(" ")[2]
141-
142-
# Remove any non-hex characters from the hash
143-
$hexHash = $sha256Hash -replace "[^0-9A-Fa-f]"
144-
145-
# Convert the hexadecimal string to a byte array
146-
$byteArray = [byte[]]@()
147-
for ($i = 0; $i -lt $hexHash.Length; $i += 2) {
148-
$byteArray += [byte]([Convert]::ToUInt32($hexHash.Substring($i, 2), 16))
149-
}
150-
151-
# Convert the byte array to a base64 string
152-
$base64String = [Convert]::ToBase64String($byteArray)
153-
154-
# Convert the base64 string to a base64url string
155-
$base64urlString = $base64String -replace '\+', '-' -replace '/', '_' -replace '=+$', ''
156-
157-
Write-Output $base64urlString
158-
```
159-
160-
:::
161-
162-
2. The default password for the debug keystore is `android`. For your production keystore, enter your chosen password.
163-
164-
3. Now append the result to `android:apk-key-hash:` to get the Facet ID:
165-
`android:apk-key-hash:POIplOLeHuvl-XAQckH0DwY4Yb1ydnnKcmhn-jibZbk`
166-
16792
## Configuration (Your back-end)
16893

16994
### Obtaining the SHA-256 Certificate Fingerprints

0 commit comments

Comments
 (0)