Skip to content
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

Add default client ids for desktop and mobile clients #38

Merged
merged 1 commit into from
May 26, 2017

Conversation

DeepDiver1975
Copy link
Member

@DeepDiver1975 DeepDiver1975 commented Mar 29, 2017

this one requires #37

@codecov
Copy link

codecov bot commented Mar 29, 2017

Codecov Report

Merging #38 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #38   +/-   ##
=========================================
  Coverage     96.95%   96.95%           
  Complexity      148      148           
=========================================
  Files            18       18           
  Lines           492      492           
=========================================
  Hits            477      477           
  Misses           15       15

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25debb4...e790201. Read the comment docs.


private static $registry = [
['Desktop Client', 'http://localhost:*', 'xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69', 'UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh'],
['Android', 'oc://android.owncloud.com', 'e4rAsNUSIUs0lF4nbv9FmCeUkTlV9GdgTLDH1b5uie7syb90SzEVrbN7HIpmWJeD', 'dInFYGV33xKzhbRmpqQltYNdfLdJIfJ9L5ISoKhNoT9qZftpdWSP71VrpGR9pmoD'],

Choose a reason for hiding this comment

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

oc:// is actually a very short name. It it not true that these need to be globally registered on the whole phone?
Would it not be better to have something longer such as owncloud:// or even owncloudauth:// ?

Also, can two different owncloud client co-exist on the same phone? (say, a branded client, the original owncloud client, and the nextcloud client)

Copy link

Choose a reason for hiding this comment

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

Good points, but only relevant for the current POC in Android. For the final implementation we will not register the callback globally and will not use an external web browser. Everything will happen in a WebView owned by the app, and only it will monitor the URLs loaded.

I like owncloud:// , that's what we used originally; oc:// was just more handy :)

@ogoffart
Copy link

Will work for the Desktop Client.

@davivel
Copy link

davivel commented Mar 31, 2017

Works for mobile clients too.

Could be moved further if the oauth2 app accepted public clients (client_id with no secret_id bound). With this approach we are setting a secret that is not really a secret.

private static $registry = [
['Desktop Client', 'http://localhost:*', 'xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69', 'UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh'],
['Android', 'oc://android.owncloud.com', 'e4rAsNUSIUs0lF4nbv9FmCeUkTlV9GdgTLDH1b5uie7syb90SzEVrbN7HIpmWJeD', 'dInFYGV33xKzhbRmpqQltYNdfLdJIfJ9L5ISoKhNoT9qZftpdWSP71VrpGR9pmoD'],
// ['iOS', '???', 'mxd5OQDk6es5LzOzRvidJNfXLUZS2oN3oUFeXPP8LpPrhx3UroJFduGEYIBOxkY1', 'KFeFWWEZO9TkisIQzR3fo7hfiMXlOpaqP8CFuTbSHzV1TUuGECglPxpiVKJfOXIx']
Copy link

Choose a reason for hiding this comment

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

Could we use oc://ios.owncloud.com as callback URL for the iOS client? The old iOS code is not testable right now, but the URI should work anyway.

@ogoffart
Copy link

What's the status before this can be merged?

@davivel
Copy link

davivel commented May 26, 2017

Fine for me, we can have the iOS callback URL when client is ready.

@DeepDiver1975 DeepDiver1975 merged commit 05fd985 into master May 26, 2017
@DeepDiver1975 DeepDiver1975 deleted the register-default-clients branch May 26, 2017 08:25
@SamuAlfageme
Copy link
Contributor

@DeepDiver1975 is this behaving as expected? Just downloaded master's .zip, installed and enabled the app and no default client ids appear in my settings... 🙄

@SamuAlfageme
Copy link
Contributor

SamuAlfageme commented Jun 20, 2017

@DeepDiver1975 bump! (see my last comment & @ogoffart's owncloud/client#5825 (comment)):

Normally, since #38 , the client app should automatically be registered, but this did not happen to me or @SamuAlfageme . So I had to manually add the client in the server DB:

INSERT INTO oc_oauth2_clients (identifier, secret, redirect_uri, name) VALUES('xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69', 'UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh', 'http://localhost:*', 'Desktop Client');

@DeepDiver1975
Copy link
Member Author

i will look into this these days ... thx for pinging

@SamuAlfageme
Copy link
Contributor

@DeepDiver1975 any news?