Skip to content

Commit 4208bd4

Browse files
authored
262 update docs with sdk implementation details (#276)
# Problem Add SDK implementation to readme. Link to GitHub Issue(s): #262 ## Steps to Verify: 1. Content is what we want. Demo: <img width="730" alt="Screenshot 2025-03-20 at 2 16 01 PM" src="https://github.com/user-attachments/assets/98ac1d2a-8803-4073-a779-daae2b6b617f" />
1 parent b05bc23 commit 4208bd4

File tree

6 files changed

+162
-2
lines changed

6 files changed

+162
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ yarn-error.log*
5555
package/
5656
vite.config.js.timestamp-*
5757
vite.config.ts.timestamp-*
58+
59+
.idea

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ The documentation is deployed to GitHub Pages automatically on merge to `main` b
9090
Library is published on merge to `main` with a development tag `0.0.0-[SHA:6]`.
9191
Releases are made via GitHub Releases with tags in the style: `vX.Y.Z`.
9292

93+
#### Mobile App Development
94+
95+
To learn more about using SIWF in your mobile app, see: [`docs/MobileAppSDK.md`](./docs/MobileAppSDK.md)
96+
9397
<!-- CONTRIBUTING -->
9498

9599
## 🤝 Contributing

assets/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dark": "#000000"
66
},
77
"content": {
8-
"title": "Sign In With Frequency"
8+
"title": "Continue with Frequency"
99
},
1010
"images": {
1111
"logoPrimary": "iVBORw0KGgoAAAANSUhEUgAAAGMAAABkCAMAAACl4H4fAAAAdVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////9gtrCq2NWAxcCVzsvV6+pVsav0+vpqu7XK5+W/4t/f8O/K5uX1+vqf09C13drU6+rq9fVQSSDuAAAAFXRSTlMA3yAQQIC/789wYK+fkH8wUKCwj2/UUKURAAACfklEQVR4Xs3ZCW7bMBCG0Z+rSGqxk3TkLem63P+IRVy3RA0lQ4kcoN8FHjiEAEKD/yxtU3Kvpb3doXXGxl7Rv4XeWYNG2cnTW/nY4EBmUvR+atKoyXoqye+xteSpNJWwJRsyIKNoT2vrNVY1dbShCeXpQNtSGoV96GhrXURRT1TTE/iMp7qCBpNWVJvSgkRGOEIMyYQwYhS1Khgs11O7Biw2UcsmLGSXgR+Hsr7fI7b8vg+Xsl7uDWVw30CNDepxV6J6g5mWUQ0MZloTCRjkkIMmEaMzyA0yBg3sMeoNMvkYUka+Ed1JGflGEpUZ8/mdPtNi8WaEQuOF1udxbUdSRv7YR1HD5VGJGSp/HGIGaQBJ2IgAemFjAKCEDQUYEjbIwIobe0RxI2KsNp4ZY4SvM54P8yfGeKwzzt/my4UzAtR243y80pyh0K018pCuAm90oLVGHtKtAzFtMr5chyRj5CGJGudTFkqNVXeeh7TG6KDKjXm+LHViDIXAGkys4dHXGscza4xVxnw6E9eIWGHMh6/EF7HfbBw/UlEWhjOYIfEZ/s3AD4l/xD0wBjMktkcAkTGYIbGlgrcoPyT+LQrFGMyQmAJec6XGkTY0Xg0rauxwzQsaAb+Lgka6GaYTMzqNW07MGPAnI2Zo/O1ByBiQM52MoZGDEzEc869vg8H9GbUCRsJdfXNjwH1G8Ub17sA2NiwWck0Nh8UeGho9ljOhmaEMsytijOqFFGPILNZ+Mr8+GUJsBym0c855A76xihhRVBTcbddfStAoz206hMOqdL+a8BprS+sGFixyIopP2NrelwkWNWnHHUY5g+p28e3TeGfRKGNdH+4A1UdrUNIvSTqR1zCLoUEAAAAASUVORK5CYII=",

docs/src/MobileAppSDK.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# 📱 Mobile App Integration
2+
3+
## **Sign-In With Frequency (SIWF) SDK Integration Guide**
4+
5+
🚀 **The SIWF SDK provides a seamless authentication experience for mobile apps. This guide walks you through integrating the SIWF SDK into your **iOS** or **Android** app.**
6+
7+
8+
9+
## 📌 **Index**
10+
1. 📱 [iOS](#iOS)
11+
2. 🤖 [Android](#Android)
12+
13+
---
14+
15+
## 📱 **iOS**
16+
17+
18+
<details>
19+
<summary>📥 Installation</summary>
20+
21+
### ⚙️ Requirements
22+
- iOS 15.0 or later
23+
- macOS 11.0 or later
24+
- Swift
25+
26+
### 📦 Installing the SIWF SDK
27+
You can install the SIWF SDK via **Swift Package Manager (SPM)**:
28+
29+
1. Open Xcode and navigate to **File → Add Packages**.
30+
2. Enter the repository URL:
31+
```
32+
https://github.com/ProjectLibertyLabs/siwf-sdk-ios
33+
```
34+
3. Select the latest stable version and add it to your project.
35+
36+
</details>
37+
38+
<details>
39+
<summary>🛠 Usage</summary>
40+
41+
### **Displaying the SIWF Sign-In Button**
42+
To create a SIWF sign-in button, use the `Siwf.createSignInButton` method:
43+
44+
```swift
45+
import Siwf
46+
47+
Siwf.createSignInButton(mode: .primary, authRequest: authRequest)
48+
```
49+
50+
</details>
51+
52+
<details>
53+
<summary>🔄 Handling Authorization Callbacks</summary>
54+
55+
### **Handling Authorization Redirects**
56+
Use `onOpenURL` and `Siwf.handleRedirectUrl` to handle deep links and retreive the authentication code.
57+
58+
</details>
59+
60+
<details>
61+
<summary>🔑 Process Authorization Code</summary><br />
62+
63+
On your backend services process the authorization code and start your session.
64+
65+
Resources:
66+
- [SIWF Documentation on Processing a Result](https://projectlibertylabs.github.io/siwf/v2/docs/Actions/Response.html)
67+
- [Frequency Gateway SSO Tutorial](https://projectlibertylabs.github.io/gateway/GettingStarted/SSO.html)
68+
</details>
69+
70+
**For more info see: [SIWF iOS SDK Source Code + Demo App](https://github.com/ProjectLibertyLabs/siwf-sdk-ios)**
71+
72+
---
73+
74+
## 🤖 **Android**
75+
76+
<details>
77+
<summary>📥 Installation</summary>
78+
79+
### ⚙️ Requirements
80+
- Android API level **24** or later
81+
- Java **11+**
82+
83+
### 📦 Installing the SIWF SDK
84+
To install the SIWF SDK via **Gradle**, add the following to your `build.gradle` file:
85+
86+
```gradle
87+
dependencies {
88+
implementation 'io.projectliberty:siwf:1.0.0'
89+
}
90+
```
91+
92+
</details>
93+
94+
<details>
95+
<summary>🛠 Usage</summary>
96+
97+
### **Displaying the SIWF Sign-In Button**
98+
To create a SIWF sign-in button in your Android app, use:
99+
100+
```kotlin
101+
import io.projectliberty.siwf.Siwf
102+
import io.projectliberty.models.SiwfButtonMode
103+
104+
Siwf.CreateSignInButton(
105+
mode = SiwfButtonMode.PRIMARY,
106+
authRequest = authRequest
107+
)
108+
```
109+
110+
</details>
111+
112+
<details>
113+
<summary>🔄 Handling Authorization Callbacks</summary>
114+
115+
### **Handling Authorization Redirects**
116+
Update your `AndroidManifest.xml` with intent filters for authentication callbacks:
117+
118+
```xml
119+
<activity
120+
android:name="io.projectliberty.helpers.AuthCallbackActivity"
121+
...
122+
<intent-filter android:autoVerify="true">
123+
...
124+
<data
125+
android:scheme="http"
126+
android:host="localhost"
127+
android:port="3000"
128+
android:path="/login/callback" />
129+
</intent-filter>
130+
<intent-filter android:autoVerify="true">
131+
... or ...
132+
<data
133+
android:scheme="siwfdemoapp"
134+
android:host="login" />
135+
</intent-filter>
136+
</activity>
137+
```
138+
139+
Then, use a `BroadcastReceiver()` to receive the authorization code.
140+
141+
</details>
142+
143+
<details>
144+
<summary>🔑 Process Authorization Code</summary><br />
145+
146+
On your backend services process the authorization code and start your session.
147+
148+
Resources:
149+
- [SIWF Documentation on Processing a Result](https://projectlibertylabs.github.io/siwf/v2/docs/Actions/Response.html)
150+
- [Frequency Gateway SSO Tutorial](https://projectlibertylabs.github.io/gateway/GettingStarted/SSO.html)
151+
</details>
152+
153+
**For more info see: [SIWF Android SDK Source Code + Demo App](https://github.com/ProjectLibertyLabs/siwf-sdk-android)**

docs/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
- [Delegations](Delegations.md)
1414
- [Payloads](Payloads.md)
1515
- [Data Structures](DataStructures/All.md)
16+
- [Mobile SDK](MobileAppSDK.md)

tools/signed-request-generator/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)