Skip to content

Commit

Permalink
Add telegram docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zorn-v committed Nov 30, 2023
1 parent 1879d5d commit 25d89d0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/2-configuring_resource_owners.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ hwi_oauth:
- [Stack Exchange](resource_owners/stack_exchange.md)
- [Stereomood](resource_owners/stereomood.md)
- [Strava](resource_owners/strava.md)
- [Telegram](resource_owners/telegram.md)
- [Toshl](resource_owners/toshl.md)
- [Trello](resource_owners/trello.md)
- [Twitch](resource_owners/twitch.md)
Expand All @@ -88,7 +89,7 @@ hwi_oauth:
### CSRF protection

Set the _csrf_ option to **true** in the resource owner's configuration in order to protect your users from [CSRF](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)) attacks.
This will be round-tripped to your application in the `state` parameter.
This will be round-tripped to your application in the `state` parameter.

Other types of state can be configured under the `state` key, either as a single string or key/value pairs. State can
also be passed directly in the `state` query parameter of your request, provided they don't override the configured keys
Expand All @@ -108,7 +109,7 @@ hwi_oauth:
options:
csrf: true
refresh_on_expire: true
state:
state:
some: parameter
some-other: parameter
```
Expand Down
35 changes: 35 additions & 0 deletions docs/resource_owners/telegram.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Step 2x: Setup Telegram
====================
First you will need to create bot via [BotFather](https://telegram.me/BotFather) and then set you site domain to it

```
/newbot
nameof_bot
```

Save token somewhere to put it as `client_secret` in config file

```
/setdomain
example.com
```
Or you can do it via botfather buttons.

Next configure a resource owner of type `telegram` with appropriate `client_secret`

```yaml
# config/packages/hwi_oauth.yaml

hwi_oauth:
resource_owners:
any_name:
type: telegram
client_id: NOT_REQUIRED # but required by bundle
client_secret: <bot_token>
```
When you're done, continue by configuring the security layer or go back to
setup more resource owners.
- [Step 2: Configuring resource owners (Facebook, GitHub, Google, Windows Live and others](../2-configuring_resource_owners.md)
- [Step 3: Configuring the security layer](../3-configuring_the_security_layer.md).

0 comments on commit 25d89d0

Please sign in to comment.