rtheunissen / oauth2-reddit Goto Github PK
View Code? Open in Web Editor NEWReddit OAuth2 provider for league/oauth2-client
License: MIT License
Reddit OAuth2 provider for league/oauth2-client
License: MIT License
Hello!
First let me just say thank you for creating this amazing library, now I have been testing some things and I needed to set de 'save' scope and I went on and did this:
$reddit = new Reddit([
. . .
'scopes' => ['identity', 'read', 'save'],
]);
But this does not add the save scope, I went on and looking to the code I can see that the variable its not call scopes
but scope
and you need to add it when you are calling the method to get the authorizationURL, like this:
$reddit->client->getAuthorizationUrl([
'duration' => 'permanent', // "permanent" or "temporary" by default
'scope' => ['identity', 'read', 'save'],
]);
Did I make something wrong? Is this the intended behaviour? Should I make a merge request to update the documentation or maybe Should I try to fix it on the code itself so the code works just like explained on the docs?
Thanks again
Cant install directly through composer since it requires v0.11.
The other php league oauth2 clients have move onto using ~1.0@dev as a dependency. Unable to update the other oauth2 clients because this client uses league/oauth2-client : 1.12.
Hey!
I tried to follow your authorization code grant like documented.
But i get "invalid grant".
Best
Philipp
When setting the duration parameter like so:
$url = $reddit->getAuthorizationUrl([
'duration' => 'permanent'
]);
The generated URL has duplicate duration parameters:
https://ssl.reddit.com/api/v1/authorize?duration=permanent&state=<scrubbed>&scope=identity%2Cread&response_type=code&approval_prompt=auto&redirect_uri=https%3A%2F%2Flocal.test%2Freddit%2Fauthorize&client_id=<scrubbed>&duration=permanent
This results in the following error when the user is redirected to Reddit:
bad request
request contains duplicate parameter for oauth2: duration
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.