Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Draft OAuth2 Documenation #3464

Merged
merged 6 commits into from
Jun 1, 2018
Merged

Draft OAuth2 Documenation #3464

merged 6 commits into from
Jun 1, 2018

Conversation

settermjd
Copy link
Contributor

@settermjd settermjd commented Oct 18, 2017

Very much a WIP.

Fixes #3299

Very much a WIP.
@settermjd settermjd added the WIP label Oct 18, 2017
@settermjd settermjd self-assigned this Oct 18, 2017
@mmattel
Copy link
Contributor

mmattel commented Nov 16, 2017

Pls add possible changes soon, then I suggest to merge this and add/change content with additional PR´s. 10.0.4 is released soon ... IMHO better this than nothing

The OAuth2 App
--------------

OAuth2 support is available in ownCloud via `an OAuth2 application`_ which is available from the ownCloud Marketplace.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the App work as Authorisation Server in ownCloud (what I believe so reading the text)? If yes than it should be stated to make the role more clear. If not or if not only, than describe the role(s) to get a link to the picture above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I read that text, it is saying that via the OAuth2 application from the Marketplace, OAuth2 client support can be added to ownCloud.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal:
OAuth2 support is available --> OAuth2 authorisation server support is available
This would make the role of the app clear.
Because an external client independent coming from owncloud itself or from any other source authorizes and connects to the server. When owncloud connects eg to dropbox via the dp-app, the dp-app is in the role of the client where db is in the role of the server.
Reduces confusion: aahhh Oauth2 app - let´s connect to sharepoint which is exactly not the possible because of the role of the app...

^^^^^^^^^^^^^^^^^^^^^^^

After the resource owner's authorization, the app redirects to the `redirect_uri` specified in the authorization request and adds the authorization code as URL parameter `code`.
An authorization code is valid for 10 minutes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens after the 10min? Is there a user interaction necessary or are there processes running in the background automatically ? If yes which or what happens?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this rather something for a developer documentation? I think here we need to document what administrators need to know. Technical overview, benefits, configuration details, minimum client versions, etc..

Copy link
Contributor Author

@settermjd settermjd Mar 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you @pmaier1. @mmattel, without having looked over the code, I'd suggest that on the next request, the user would have to grant access again to gain a new authorization code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, @pmaier1, on reading the text again, it makes sense to keep the background information and configuration documentation together, rather than have the admin/user search for one or the other. I'd suggest to keep it as it is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal:
An authorization code is valid for 10 minutes. --> For security reasons, an authorization code is valid for 10 minutes. If the client tries to use the authorization code more than once, the authorization server denies the request.

^^^^^^^^^^^^^^^^^^^^^

The app responses to a valid access token request with a JSON response like the following.
An access token is valid for 1 hour and can be refreshed with a refresh token.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above, the token is valid for 10min. Now the token is valid for 1h...
Additionally same question as above, what happens if it expires... Can be refreshed means what ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess above is referring to the authorization code, with this being valid for 10 minutes. An authorization code can then be used for requesting an access token, with this being valid for max 1 hour. Or at least this is what I understood..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest there's some confusion between authorization code and access token going on. Here's a good description of them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not adding the link (good description) to ease understanding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Installation
------------

To install the application, place the content of the OAuth2 app inside your installation's ``app`` directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Respectively use the Market App

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with other ownCloud apps we do not have to document the installation process as it's always the same. Either you install it manually as described or you use the market app. IMO we only need to explain installation when there are dependencies on other software like Collabora or full text search or stuff like that.

Limitations
-----------

Since the app handles no user passwords, only master key encryption works (similar to `the Shibboleth app`_).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What to do in case of any other encryption type ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this info come from? I use OAuth on an instance that uses credential-based storage encryption. Works like a charm.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: The statement regarding credential-based storage encryption is correct. Sorry, my bad.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a link to owncloud/oauth2#105?

@mmattel
Copy link
Contributor

mmattel commented Nov 29, 2017

@DeepDiver1975
you have filed a lot of PR´s in oAuth2.
Can you pls take a look on this and give some advice for corrections and/or additions?

@SamuAlfageme SamuAlfageme self-requested a review November 30, 2017 09:04
To install the application, place the content of the OAuth2 app inside your installation's ``app`` directory.

Basic Configuration
-------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You basically don't have to configure anything in oC itself. Here we need information on configuring the basic infrastructure around it and how to cover special cases like SSO #3456 owncloud/oauth2#49


Restricting Usage
-----------------

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we need info about how to "lock-out" the original oC clients and e.g. only allow the usage of branded clients with special client id/secret.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added content around this point, taken from owncloud/oauth2#72.


Connecting Clients via OAuth2
-----------------------------

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Basic howto is explained in the blog post
  • Basic auth will still be possible for e.g. legacy WebDAV clients that don't support OAuth

@SamuAlfageme
Copy link
Contributor

Requires references to owncloud/oauth2#110

Copy link
Contributor

@SamuAlfageme SamuAlfageme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This owncloud/core#29300 is also worth a mention somewhere in the docs.

-----------------


Limitations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more limitation: owncloud/oauth2#109 (comment) -> clients are unable to migrate an account from Basic Auth. to OAuth2 if they come from the user_ldap backend.


Restricting Usage
-----------------

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@settermjd
Copy link
Contributor Author

settermjd commented Mar 15, 2018

@SamuAlfageme, as owncloud/core#29300 and owncloud/core#29324 are not yet implemented, can you create an issue to document it when that functionality is completed and merged, pls?

Edit:
issue: owncloud/core#29300 has been closed on 23 Oct 2017 in favor of 29324
issue: owncloud/core#29324 [FR] Add a switch to enable/disable token authentication enforcement

@settermjd
Copy link
Contributor Author

@SamuAlfageme, reference to owncloud/oauth2#110 has been added.

@SamuAlfageme
Copy link
Contributor

@settermjd

owncloud/core#29300 and owncloud/core#29324 are not yet implemented, can you create an issue to document it when that functionality is completed and merged, pls?

They're tho, see status and refer to owncloud/core#29300 (comment) for instructions on how to enable token-only based logins.

settermjd added a commit that referenced this pull request Mar 19, 2018
@mmattel
Copy link
Contributor

mmattel commented Mar 29, 2018

Enable token-only based logins: config.sample.php: 'token_auth_enforced' => false,

@settermjd
Copy link
Contributor Author

@SamuAlfageme @mmattel are your final two comments all that's left to be implemented on this PR?

@mmattel
Copy link
Contributor

mmattel commented May 9, 2018

If you add my 2 proposal texts I am fine.
Pls fix them if they do not look nice, but contentwise they should be in.

It is better to have that merged soon instead discussing / keeping this open endless.
Further improvements can always be added, just my opinion.

@settermjd
Copy link
Contributor Author

@mmattel doing that today.

@settermjd
Copy link
Contributor Author

@mmattel your changes have been integrated in the text.

@settermjd
Copy link
Contributor Author

Is it correct to say: To enable token-only based logins in config/config.php set token_auth_enforced to true?

@mmattel
Copy link
Contributor

mmattel commented May 18, 2018

From that whatI understood the key was implemented for - yes.
I would be be more precise:
To enable token-only based logins --> To enable token-only based app or client logins
as web login is not affected

@settermjd
Copy link
Contributor Author

@mmattel, line added. Thanks for the further suggestion.

@mmattel
Copy link
Contributor

mmattel commented May 24, 2018

Let´s merge this, additions can be added later.

@settermjd settermjd merged commit 12549e1 into master Jun 1, 2018
@settermjd settermjd deleted the document-oauth2 branch June 1, 2018 11:53
settermjd added a commit that referenced this pull request Jun 1, 2018
settermjd added a commit that referenced this pull request Jun 1, 2018
settermjd added a commit that referenced this pull request Jun 1, 2018
settermjd added a commit that referenced this pull request Jun 1, 2018
settermjd added a commit that referenced this pull request Jun 1, 2018
@settermjd
Copy link
Contributor Author

Backported to Antora build in 482a918.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants