Skip to content

Commit ea8b5f6

Browse files
committed
Explain how to deal with Rate Limiting in the OIDC providers doc
1 parent 69247f1 commit ea8b5f6

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

docs/src/main/asciidoc/security-openid-connect-providers.adoc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ TIP: You can also send access tokens issued by `Google` to `quarkus.oidc.applica
119119
=== Mastodon
120120

121121
Create a https://joinmastodon.org/[Mastodon account]. You must https://joinmastodon.org/servers[pick a server], for example, `mastodon.social`.
122-
Select a `Development` option in you account and register an application, for example:
122+
Select a `Development` option in your account and register an application, for example:
123123

124124
image::oidc-mastodon-register-app.png[role="thumb"]
125125

@@ -642,6 +642,26 @@ The pattern of authenticating with a given provider, where the endpoint uses eit
642642

643643
Some providers will only accept HTTPS-based redirect URLs. Tools such as https://ngrok.com/[ngrok] https://linuxhint.com/set-up-use-ngrok/[can be set up] to help testing such providers with Quarkus endpoints running on localhost in devmode.
644644

645+
== Rate Limiting
646+
647+
Depending on your developer API subscription level, some providers may enforce a rather strict request rate limiting policy.
648+
649+
It may not be a problem when Quarkus fetches public verification keys from OIDC-compliant providers like the <<google>> provider and keeps verifying the user session with these keys locally. However, for pure OAuth2 providers where only an access token is available and which has to be verified indirectly by requesting UserInfo from the provider endpoint on every request done by an already authenticated user, it can become a problem.
650+
651+
In such cases consider xref:security-oidc-bearer-token-authentication#token-introspection-userinfo-cache[caching UserInfo], using either a default or custom cache implementation or even embedding UserInfo in an internally generated ID token which is encrypted by default, for example:
652+
653+
[source,properties]
654+
----
655+
quarkus.oidc.provider=x
656+
quarkus.oidc.client-id=<Client ID>
657+
quarkus.oidc.credentials.secret=<Secret>
658+
quarkus.oidc.authentication.extra-params.scope=tweet.write
659+
quarkus.rest-client.twitter-client.url=https://api.twitter.com/2
660+
661+
quarkus.oidc.cache-user-info-in-idtoken=true <1>
662+
----
663+
<1> Cache UserInfo by embedding it in the internally generated ID token
664+
645665
== References
646666

647667
* xref:security-oidc-code-flow-authentication.adoc[OIDC code flow mechanism for protecting web applications]

0 commit comments

Comments
 (0)