You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+97-18Lines changed: 97 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
[](https://packagist.org/packages/capcom6/android-sms-gateway)
A modern PHP client for seamless integration with the [SMS Gateway for Android](https://sms-gate.app) API. Send SMS messages, manage devices, and configure webhooks through your PHP applications with this intuitive library.
8
+
A modern PHP client for seamless integration with the [SMSGate](https://sms-gate.app) API. Send SMS messages, manage devices, and configure webhooks through your PHP applications with this intuitive library.
9
9
10
10
## 🔖 Table of Contents
11
11
@@ -17,8 +17,15 @@ A modern PHP client for seamless integration with the [SMS Gateway for Android](
17
17
-[🚀 Quickstart](#-quickstart)
18
18
-[Sending an SMS](#sending-an-sms)
19
19
-[Managing Devices](#managing-devices)
20
+
-[🔐 Authentication](#-authentication)
21
+
-[Basic Authentication](#basic-authentication)
22
+
-[JWT Authentication](#jwt-authentication)
23
+
-[Generating a JWT Token](#generating-a-jwt-token)
24
+
-[Using a JWT Token](#using-a-jwt-token)
25
+
-[Revoking a JWT Token](#revoking-a-jwt-token)
20
26
-[📚 Full API Reference](#-full-api-reference)
21
27
-[Client Initialization](#client-initialization)
28
+
-[Basic Authentication](#basic-authentication-1)
22
29
-[Core Methods](#core-methods)
23
30
-[Builder Methods](#builder-methods)
24
31
-[🔒 Security Notes](#-security-notes)
@@ -36,6 +43,8 @@ A modern PHP client for seamless integration with the [SMS Gateway for Android](
-**Dual Authentication**: Support for both Basic and JWT authentication
47
+
-**Token Management**: Generate, use, and revoke JWT tokens with configurable scopes and TTL
39
48
40
49
## ⚙️ Prerequisites
41
50
@@ -103,36 +112,106 @@ try {
103
112
}
104
113
```
105
114
115
+
## 🔐 Authentication
116
+
117
+
The SMSGate client supports two authentication methods: Basic Authentication and JWT (JSON Web Token) authentication. Each method has its own use cases and benefits.
118
+
119
+
### Basic Authentication
120
+
121
+
```php
122
+
// Initialize client with Basic authentication
123
+
$client = new Client('your_login', 'your_password');
124
+
```
125
+
126
+
### JWT Authentication
127
+
128
+
JWT authentication uses bearer tokens for authentication.
129
+
130
+
#### Generating a JWT Token
131
+
132
+
```php
133
+
use AndroidSmsGateway\Client;
134
+
use AndroidSmsGateway\Domain\TokenRequest;
135
+
136
+
// First, create a client with Basic authentication to generate a token
137
+
$basicClient = new Client('your_login', 'your_password');
138
+
139
+
// Create a token request with specific scopes and TTL
140
+
$tokenRequest = new TokenRequest(
141
+
['messages:send', 'messages:read'], // Scopes for permissions
0 commit comments