Skip to content

Commit 3ab45a4

Browse files
authored
Update README.md (#74)
1 parent a0a1fdd commit 3ab45a4

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
# PropelAuth
1+
<p align="center">
2+
<a href="https://www.propelauth.com?ref=github" target="_blank" align="center">
3+
<img src="https://www.propelauth.com/imgs/lockup.svg" width="200">
4+
</a>
5+
</p>
6+
7+
# PropelAuth Rust Library
28

39
Add authentication and authorization to your application.
410

511
This library is meant to be used with a [PropelAuth](https://www.propelauth.com/) account.
612
You can sign up and get started for free.
713

8-
# Initialize
14+
## Initialize
915

1016
First, you'll need to initialize the library. You can either call `PropelAuth::init`
1117
or `PropelAuth::fetch_and_init` (which will fetch any unspecified metadata).
@@ -17,7 +23,7 @@ let auth = PropelAuth::fetch_and_init(AuthOptions {
1723
}).await.expect("Unable to initialize authentication");
1824
```
1925

20-
# Usage / Protecting APIs
26+
## Usage / Protecting APIs
2127

2228
- [Axum](#axum)
2329
- [Actix](#actix)
@@ -40,7 +46,7 @@ let app = Router::new()
4046
.layer(auth_layer); // <-- here
4147
```
4248

43-
You can then take `User` in as an argument, which will look for an [access token](https://docs.propelauth.com/overview/access-token/) in the Authorization header.
49+
You can then take `User` in as an argument, which will look for an [access token](https://docs.propelauth.com/guides-and-examples/guides/access-tokens) in the Authorization header.
4450

4551
```rust
4652
// User will automatically return a 401 (Unauthorized) if a valid access token wasn't provided
@@ -49,7 +55,7 @@ async fn whoami(user: User) -> String {
4955
}
5056
```
5157

52-
You can also check which [organizations](https://docs.propelauth.com/overview/organizations/) the user is in, and which [roles and permissions](https://docs.propelauth.com/overview/rbac/) they have.
58+
You can also check which [organizations](https://docs.propelauth.com/overview/organizations/) the user is in, and which [roles and permissions](https://docs.propelauth.com/overview/authorization/rbac) they have.
5359

5460
```rust
5561
// If the user isn't in the provided organization, a 403 is returned
@@ -90,7 +96,7 @@ HttpServer::new(move || {
9096
})
9197
```
9298

93-
You can then take `User` in as an argument, which will look for an [access token](https://docs.propelauth.com/overview/access-token/) in the Authorization header.
99+
You can then take `User` in as an argument, which will look for an [access token](https://docs.propelauth.com/guides-and-examples/guides/access-tokens) in the Authorization header.
94100

95101
```rust
96102
// User will automatically return a 401 (Unauthorized) if a valid access token wasn't provided
@@ -100,7 +106,7 @@ async fn whoami(user: User) -> impl Responder {
100106
}
101107
```
102108

103-
You can also check which [organizations](https://docs.propelauth.com/overview/organizations/) the user is in, and which [roles and permissions](https://docs.propelauth.com/overview/rbac/) they have.
109+
You can also check which [organizations](https://docs.propelauth.com/overview/organizations/) the user is in, and which [roles and permissions](https://docs.propelauth.com/overview/authorization/rbac) they have.
104110

105111
```rust
106112
// If the user isn't in the provided organization, a 403 is returned
@@ -136,7 +142,7 @@ propelauth = { version >= "0.12.1", features = ["rustls"], default-features = fa
136142

137143
## Other
138144

139-
After initializing `auth`, you can verify [access tokens](https://docs.propelauth.com/overview/access-token/) by passing in the Authorization header (formatted `Bearer TOKEN`):
145+
After initializing `auth`, you can verify [access tokens](https://docs.propelauth.com/guides-and-examples/guides/access-tokens) by passing in the Authorization header (formatted `Bearer TOKEN`):
140146

141147
```rust
142148
let result = auth.verify().validate_authorization_header(&authorization_header);
@@ -145,7 +151,7 @@ match result {
145151
Err(_) => { /* invalid access token, typically we return a 401 Unauthorized here */ }
146152
}
147153
```
148-
You can also check which [organizations](https://docs.propelauth.com/overview/organizations/) the user is in, and which [roles and permissions](https://docs.propelauth.com/overview/rbac/) they have.
154+
You can also check which [organizations](https://docs.propelauth.com/overview/organizations/) the user is in, and which [roles and permissions](https://docs.propelauth.com/overview/authorization/rbac) they have.
149155

150156
```rust
151157
let org = auth.validate_org_membership(
@@ -163,7 +169,7 @@ let org = user.validate_org_membership(
163169

164170
And finally, you can make API calls directly from `auth.user()` and `auth.org()`
165171

166-
# Where do the access tokens come from?
172+
## Where do the access tokens come from?
167173

168174
They come from your frontend.
169-
You can read more about integrating your frontend [here](https://docs.propelauth.com/getting-started/frontend-integration/).
175+
You can read more about integrating your frontend [here](https://docs.propelauth.com/getting-started/quickstart-fe).

0 commit comments

Comments
 (0)