Skip to content

Latest version of CERB API OAuth2 real-world examples #53

Locked Answered by jstanden
bencarrasco asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @bencarrasco!

With PHP you can use GuzzleHttp or cURL directly. Once you have an OAuth2 token you just include it in the Authorization: Bearer <token> header.

If it's a low-risk scenario (e.g. creating tickets from a web form), that token could be manually generated and long-lived (months). You'd rotate it occasionally.

If it's a higher-risk scenario (e.g. PII customer data) then it's best to stick with the 1-hour expiring access token and use the refresh token to replace it.

This is a great OAuth2 client library for PHP, but it might be overkill for a simple API script:
https://github.com/thephpleague/oauth2-client

I recommend using something like Paw https://paw.cloud or Postman http…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by jstanden
Comment options

You must be logged in to vote
1 reply
@jstanden
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants