-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement OAuth method #7257
Implement OAuth method #7257
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7257 +/- ##
==========================================
- Coverage 94.01% 93.82% -0.19%
==========================================
Files 179 179
Lines 13144 13247 +103
==========================================
+ Hits 12357 12429 +72
- Misses 787 818 +31
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments. Can you write some test cases? Looks like there is 1 failing test.
Co-Authored-By: Manuel <[email protected]> Co-Authored-By: Diamond Lewis <[email protected]>
Removes unnecessary code comments and corrects the signup method to return the refreshToken.
Codecov lets you know which lines of code are missing tests. Please add your new test cases in Auth.spec.js Here are a few that are missing
|
How to include the refresh token and revoke token checks if there is no parameter to enter the URL?
Good morning, I really need help. Codecov is not a tool that I am aware of and I do not want to let this functionality die because of this barrier. Please help me! |
Did you install mongo runner before running the test and make sure it's version 4.4? |
I could write the tests myself but I figure its more important to get your testing environment setup. We may need to update our documentation to help other developers. As a workaround you could install mongodb directly https://docs.mongodb.com/manual/administration/install-community/
|
@jjunineuro great work! I have a few questions below: When refreshing:
When revoking:
It seems the difference between Last question, can |
Change name of variables, suggestions from @cbaker6
Hello @cbaker6, sorry for the delay in responding, but I was busy with work without time for open source. I made the changes you suggested:
I took the parameters based on the guidelines of RFC 6749.
I am also preparing the SDK template to respond to the use of OAuth. It will be something like:
When the SDK starts Parse Server and has "oauth20 = true" as a parameter:
I hope that this project can proceed successfully, as it will be a big increase for both Mobile and Web. I am experiencing great difficulty with the case tests. @dplewis listed what I should change in "spec / Auth.spec.js", but I don't know the "codecov" I spent all morning, I searched for tutorials, Google searches but without success. If this is the barrier to being able to contribute to the community, unfortunately I will be very sad, because I do not know the "codedov" and I do not know how to create in the new case tests. |
@jjunineuro Ignore code coverage for right now since it doesn't effect the actual test themselves. Can you run the test suite? Can you give me access to your fork? |
@davimacedo so you have the same concerns here that you mentioned in #7226 (comment)? |
What do you all think about |
I sent the invite to access to fork. |
I can change yes .. |
I just read your RFC link. It looks like it's:
Which makes sense why they called in If you do it the way I mentioned above, |
Yes @cbaker6, I am using the server clock, |
In this scenario is your intention for the developer to only use |
That's right, "oauth" is defined on the server side. However, when it is true, it will no longer send the "sessionToken" as a response to Login / Signup. |
This could work, but I was under the impression that either the |
Let me add some test cases and clean up so we can see whats going on. |
We could create a new header. This would allow out of the box configurations since we know that an accessToken would be jwt. @jjunineuro I added some test cases. Can you try to run them locally? |
A small change you might want to consider is the server is returning |
Switched |
Update on testing on a Swift client:
Problems I ran into:
Things to think about:
|
Put oauthTTL instead of the fixed value and put the same return in /users/me
Hi guys, I'm sorry to be absent this week. I had some problems which made time for the open community impossible. @dplewis, thank you very much for committing the case tests. I will test them all now. @cbaker6, I just made a correction now to change the fixed value 1800 to the variable "oauthTTL" and also put the same return response for the current user method. The methods of "refresh" and "revoke" were defined as follows:
|
If there are still any more tasks, please inform. I ask, should this be done in the README.md file? |
@cbaker6, the expiresAt is not saved in the database nor is the accessToken. So createAt may not be the same as createdAt. That is why in the Parse Server options the parameter "expireInactiveSessions" must be set to false. The validity period of the token is defined in your body, in the payload parameter "exp" and this information does not need to be saved in a bank. For example, you have logged in now 2021-03-21 19:27:13 and in an hour, you decide to request a list from the bank. In this case, the device will verify by the "expiresAt" that the token has expired, so before requesting the list, it must request the refresh of the accessToken, and only then, continue requesting the list. |
What happens if the device decides to ignore |
will return the following exception: |
May I ask what is the status on this PR and if this is planned to be released with next server version release? Thank you! |
@jjunineuro what is the status here? |
As this was not implemented in the 4.10.0 i would like to rise the question whether it is planned to include in 5.0. or not? I see there is one requested change and I assume these are missing tests cases, but then also "All conversations are resolved"? |
@lsmilek1 @bdevore17 Thanks for your questions. Release 4.10.0 was a security release, it was not supposed to include any features. I assume and hope that this feature will be merged on time to be part of Parse Server 5.0. We will likely do a feature freeze for version 5.0 later this year, so there are still some months left to merge this PR. The reason I removed the requested review is that there are conflicting files that need to be resolved to review this further. Once the conflict is resolved, the review process will continue. |
|
@mtrezza Did this miss the deadline? |
@bdevore17 We have moved the deadline to November, so if you or anyone else wants to pick this up, please do. I should say that it's always possible to add this feature anytime after the deadline, but if it contains a breaking change, we'd have to add a deprecation and let the developer turn it on optionally. That shouldn't be a big deal, we are doing this already with some other features. |
@mtrezza Is this just waiting on a rebase? |
New Pull Request Checklist
Issue Description
Related issue: This is the initial version, so you can test it out. Inclusion of routines for OAuth, discussed in #7248
Approach
TODOs before merging