[Update] Zinc-SSO now supports Dropbox !

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
33 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Update] Zinc-SSO now supports Dropbox !

Sven Van Caekenberghe-2
Hi,

I am happy to report that Zinc-SSO now supports the Dropbox API. Which means you can write (web) applications that access (read/write) files in a user's Dropbox account. 

Jan extended Zinc-SSO-OAuth1-Core to support both version 1 and version 1a of OAuth1 which I then used for a demo.

Again, the actual setup is non-trivial, and a public demo is not easy either, so there is only this screenshot:


This is what you see after allowing the Zinc-SSO app access to a special 'sandbox' folder called Apps/Zinc-SSO (full 'root' Dropbox access is possible as well). Here you can see there is one file, readme.txt in the folder.

If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.

Sven

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill

Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

EstebanLM
so f***ing cool! 

thanks Sven :)


On Jan 27, 2013, at 1:32 PM, Sven Van Caekenberghe <[hidden email]> wrote:

Hi,

I am happy to report that Zinc-SSO now supports the Dropbox API. Which means you can write (web) applications that access (read/write) files in a user's Dropbox account. 

Jan extended Zinc-SSO-OAuth1-Core to support both version 1 and version 1a of OAuth1 which I then used for a demo.

Again, the actual setup is non-trivial, and a public demo is not easy either, so there is only this screenshot:

<Screen Shot 2013-01-27 at 13.15.36.png>

This is what you see after allowing the Zinc-SSO app access to a special 'sandbox' folder called Apps/Zinc-SSO (full 'root' Dropbox access is possible as well). Here you can see there is one file, readme.txt in the folder.

If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.

Sven

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Stéphane Ducasse

On Jan 27, 2013, at 9:42 AM, Esteban Lorenzano wrote:

> so f***ing cool!

+1
I love to see more and more of these connections to the outside world.

>
> thanks Sven :)
>
>
> On Jan 27, 2013, at 1:32 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>
>> Hi,
>>
>> I am happy to report that Zinc-SSO now supports the Dropbox API. Which means you can write (web) applications that access (read/write) files in a user's Dropbox account.
>>
>> Jan extended Zinc-SSO-OAuth1-Core to support both version 1 and version 1a of OAuth1 which I then used for a demo.
>>
>> Again, the actual setup is non-trivial, and a public demo is not easy either, so there is only this screenshot:
>>
>> <Screen Shot 2013-01-27 at 13.15.36.png>
>>
>> This is what you see after allowing the Zinc-SSO app access to a special 'sandbox' folder called Apps/Zinc-SSO (full 'root' Dropbox access is possible as well). Here you can see there is one file, readme.txt in the folder.
>>
>> If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
>>
>> Sven
>>
>> --
>> Sven Van Caekenberghe
>> http://stfx.eu
>> Smalltalk is the Red Pill
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Denis Kudriashov
In reply to this post by Sven Van Caekenberghe-2
Cool!
Do you already have FileSystem backend for this?

2013/1/27 Sven Van Caekenberghe <[hidden email]>
Hi,

I am happy to report that Zinc-SSO now supports the Dropbox API. Which means you can write (web) applications that access (read/write) files in a user's Dropbox account. 

Jan extended Zinc-SSO-OAuth1-Core to support both version 1 and version 1a of OAuth1 which I then used for a demo.

Again, the actual setup is non-trivial, and a public demo is not easy either, so there is only this screenshot:


This is what you see after allowing the Zinc-SSO app access to a special 'sandbox' folder called Apps/Zinc-SSO (full 'root' Dropbox access is possible as well). Here you can see there is one file, readme.txt in the folder.

If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.

Sven

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sven Van Caekenberghe-2
In reply to this post by Sven Van Caekenberghe-2

On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:

> If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.

How to run the Dropbox code yourself:

1. Get yourself a free Dropbox account at http://www.dropbox.com

2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.

3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications

4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.

5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.

6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).

Gofer it
  url: 'http://mc.stfx.eu/ZincHTTPComponents';
  package: 'ConfigurationOfZincHTTPComponents';
  load.

ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.

7. Start a Zn server with an appropriate delegate, configured for your app

(ZnServer startDefaultOn: 8100)
        logToTranscript;
        debugMode: true;
        delegate: (ZnSSOServerDelegate new
                dropboxData: (ZnOAuth1ConsumerData newForDropbox
                                                                consumer: 'vqz-app-key-zoca';
                                                                consumerSecret: '13u-app-secret-8l006';
                                                                yourself);
                yourself).

(The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).

8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.

9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.

10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.

We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.

As always, May the Source be with you!
 
Sven

PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sven Van Caekenberghe-2
In reply to this post by Denis Kudriashov

On 27 Jan 2013, at 15:55, Denis Kudriashov <[hidden email]> wrote:

> Cool!
> Do you already have FileSystem backend for this?

Denis,

I had not yet thought of that. It *is* a cool idea though. An ideal student project I would say.

> 2013/1/27 Sven Van Caekenberghe <[hidden email]>
> Hi,
>
> I am happy to report that Zinc-SSO now supports the Dropbox API. Which means you can write (web) applications that access (read/write) files in a user's Dropbox account.
>
> Jan extended Zinc-SSO-OAuth1-Core to support both version 1 and version 1a of OAuth1 which I then used for a demo.
>
> Again, the actual setup is non-trivial, and a public demo is not easy either, so there is only this screenshot:
>
> <Screen Shot 2013-01-27 at 13.15.36.png>
>
> This is what you see after allowing the Zinc-SSO app access to a special 'sandbox' folder called Apps/Zinc-SSO (full 'root' Dropbox access is possible as well). Here you can see there is one file, readme.txt in the folder.
>
> If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
>
> Sven
>
> --
> Sven Van Caekenberghe
> http://stfx.eu
> Smalltalk is the Red Pill
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sean P. DeNigris
Administrator
In reply to this post by Stéphane Ducasse
Stéphane Ducasse wrote
On Jan 27, 2013, at 9:42 AM, Esteban Lorenzano wrote:

> so f***ing cool!

+1
I love to see more and more of these connections to the outside world.
+1 & +1 :)
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Ben Coman
Sean P. DeNigris wrote:

> Stéphane Ducasse wrote
>  
>> On Jan 27, 2013, at 9:42 AM, Esteban Lorenzano wrote:
>>
>>    
>>> so f***ing cool!
>>>      
>> +1
>> I love to see more and more of these connections to the outside world.
>>    
>
> +1 & +1 :)
>
>
>
> --
> View this message in context: http://forum.world.st/Update-Zinc-SSO-now-supports-Dropbox-tp4665692p4665768.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
>
>  
And I get 50GB free space with my Samsung phone.  :) :)

Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

cedreek
In reply to this post by Sven Van Caekenberghe-2
Cool Sven, nice work :)

Cheers,

Cédrick

Le 27 janv. 2013 à 13:32, Sven Van Caekenberghe <[hidden email]> a écrit :

Hi,

I am happy to report that Zinc-SSO now supports the Dropbox API. Which means you can write (web) applications that access (read/write) files in a user's Dropbox account. 

Jan extended Zinc-SSO-OAuth1-Core to support both version 1 and version 1a of OAuth1 which I then used for a demo.

Again, the actual setup is non-trivial, and a public demo is not easy either, so there is only this screenshot:

<Screen Shot 2013-01-27 at 13.15.36.png>

This is what you see after allowing the Zinc-SSO app access to a special 'sandbox' folder called Apps/Zinc-SSO (full 'root' Dropbox access is possible as well). Here you can see there is one file, readme.txt in the folder.

If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.

Sven

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sven Van Caekenberghe-2

On 28 Jan 2013, at 16:23, Cédrick Béler <[hidden email]> wrote:

> Cool Sven, nice work :)

Thanks, but it is Jan who is the real expert here, having done all this from first principles himself, I am lucky to be able to work with him to bring all this on our platform.

> Cheers,
>
> Cédrick
>
> Le 27 janv. 2013 à 13:32, Sven Van Caekenberghe <[hidden email]> a écrit :
>
>> Hi,
>>
>> I am happy to report that Zinc-SSO now supports the Dropbox API. Which means you can write (web) applications that access (read/write) files in a user's Dropbox account.
>>
>> Jan extended Zinc-SSO-OAuth1-Core to support both version 1 and version 1a of OAuth1 which I then used for a demo.
>>
>> Again, the actual setup is non-trivial, and a public demo is not easy either, so there is only this screenshot:
>>
>> <Screen Shot 2013-01-27 at 13.15.36.png>
>>
>> This is what you see after allowing the Zinc-SSO app access to a special 'sandbox' folder called Apps/Zinc-SSO (full 'root' Dropbox access is possible as well). Here you can see there is one file, readme.txt in the folder.
>>
>> If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
>>
>> Sven
>>
>> --
>> Sven Van Caekenberghe
>> http://stfx.eu
>> Smalltalk is the Red Pill
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sabine Manaa
In reply to this post by Sven Van Caekenberghe-2
Hi Sven,

after loading:

Gofer it
  url: 'http://mc.stfx.eu/ZincHTTPComponents';
  package: 'ConfigurationOfZincHTTPComponents';
  load.

ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.

The ZnOAuth1ConsumerData does not have a method called >>newForDropbox (but >>newForGoogle and >>newForTwitter).
Also, ZnSSOServerDelegate does not have a method >>dropboxData: (but facebook, twittter and google)

Did I miss something?

Greetings
Sabine


On Sun, Jan 27, 2013 at 8:47 PM, Sven Van Caekenberghe <[hidden email]> wrote:

On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:

> If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.

How to run the Dropbox code yourself:

1. Get yourself a free Dropbox account at http://www.dropbox.com

2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.

3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications

4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.

5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.

6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).

Gofer it
  url: 'http://mc.stfx.eu/ZincHTTPComponents';
  package: 'ConfigurationOfZincHTTPComponents';
  load.

ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.

7. Start a Zn server with an appropriate delegate, configured for your app

(ZnServer startDefaultOn: 8100)
        logToTranscript;
        debugMode: true;
        delegate: (ZnSSOServerDelegate new
                dropboxData: (ZnOAuth1ConsumerData newForDropbox
                                                                consumer: 'vqz-app-key-zoca';
                                                                consumerSecret: '13u-app-secret-8l006';
                                                                yourself);
                yourself).

(The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).

8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.

9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.

10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.

We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.

As always, May the Source be with you!

Sven

PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill



Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Jan van de Sandt
Hello Sabine,

The package versions that support Dropbox are not yet part of ConfigurationOfZincHTTPComponent. If you load the latest versions of the Zinc-SSO packages using the Monticello browser it should work.
 
Jan.

On Wed, Jan 30, 2013 at 4:24 PM, Sabine Knöfel <[hidden email]> wrote:
Hi Sven,

after loading:


Gofer it
  url: 'http://mc.stfx.eu/ZincHTTPComponents';
  package: 'ConfigurationOfZincHTTPComponents';
  load.

ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.

The ZnOAuth1ConsumerData does not have a method called >>newForDropbox (but >>newForGoogle and >>newForTwitter).
Also, ZnSSOServerDelegate does not have a method >>dropboxData: (but facebook, twittter and google)

Did I miss something?

Greetings
Sabine


On Sun, Jan 27, 2013 at 8:47 PM, Sven Van Caekenberghe <[hidden email]> wrote:

On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:

> If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.

How to run the Dropbox code yourself:

1. Get yourself a free Dropbox account at http://www.dropbox.com

2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.

3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications

4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.

5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.

6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).

Gofer it
  url: 'http://mc.stfx.eu/ZincHTTPComponents';
  package: 'ConfigurationOfZincHTTPComponents';
  load.

ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.

7. Start a Zn server with an appropriate delegate, configured for your app

(ZnServer startDefaultOn: 8100)
        logToTranscript;
        debugMode: true;
        delegate: (ZnSSOServerDelegate new
                dropboxData: (ZnOAuth1ConsumerData newForDropbox
                                                                consumer: 'vqz-app-key-zoca';
                                                                consumerSecret: '13u-app-secret-8l006';
                                                                yourself);
                yourself).

(The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).

8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.

9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.

10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.

We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.

As always, May the Source be with you!

Sven

PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill




Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sven Van Caekenberghe-2
In reply to this post by Sabine Manaa
Sabine,

On 30 Jan 2013, at 16:24, Sabine Knöfel <[hidden email]> wrote:

> Hi Sven,
>
> after loading:
>
> Gofer it
>   url: 'http://mc.stfx.eu/ZincHTTPComponents';
>   package: 'ConfigurationOfZincHTTPComponents';
>   load.
>
> ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
>
> The ZnOAuth1ConsumerData does not have a method called >>newForDropbox (but >>newForGoogle and >>newForTwitter).
> Also, ZnSSOServerDelegate does not have a method >>dropboxData: (but facebook, twittter and google)
>
> Did I miss something?

Yes and no. The latest stable version of the configuration does not yet include the Dropbox code.
The following will load what is called bleedingEdge, the very latest version of everything, regardless of its release status.

  ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.

Sorry about that.

Sven

> Greetings
> Sabine
>
>
> On Sun, Jan 27, 2013 at 8:47 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>
> On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:
>
> > If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
>
> How to run the Dropbox code yourself:
>
> 1. Get yourself a free Dropbox account at http://www.dropbox.com
>
> 2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.
>
> 3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications
>
> 4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.
>
> 5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.
>
> 6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).
>
> Gofer it
>   url: 'http://mc.stfx.eu/ZincHTTPComponents';
>   package: 'ConfigurationOfZincHTTPComponents';
>   load.
>
> ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
>
> 7. Start a Zn server with an appropriate delegate, configured for your app
>
> (ZnServer startDefaultOn: 8100)
>         logToTranscript;
>         debugMode: true;
>         delegate: (ZnSSOServerDelegate new
>                 dropboxData: (ZnOAuth1ConsumerData newForDropbox
>                                                                 consumer: 'vqz-app-key-zoca';
>                                                                 consumerSecret: '13u-app-secret-8l006';
>                                                                 yourself);
>                 yourself).
>
> (The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).
>
> 8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.
>
> 9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.
>
> 10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.
>
> We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.
>
> As always, May the Source be with you!
>
> Sven
>
> PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.
>
> --
> Sven Van Caekenberghe
> http://stfx.eu
> Smalltalk is the Red Pill
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sabine Manaa
Hi Sven, hi Jan,

thank you.
I am one step further now but there must be something else missing to load.
I failed with my current image, so I tried the following:

I took a fresh image - the Pharo 1.4. one click app from the pharo homepage
(http://gforge.inria.fr/frs/download.php/31258/Pharo-1.4-14557-OneClick.zip)

Then I loaded seaside 3.0 (from the welcome screen - MetacelloConfigurationBrowser open).

After that, I loaded

Gofer it
  url: 'http://mc.stfx.eu/ZincHTTPComponents';
  package: 'ConfigurationOfZincHTTPComponents';
  load.

And then the bleeding Edge version
ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.

Then this was possible:
(ZnServer startDefaultOn: 8100)
        logToTranscript;
        debugMode: true;
        delegate: (ZnSSOServerDelegate new
                dropboxData: (ZnOAuth1ConsumerData newForDropbox
                                                                consumer: 'my appdata';
                                                                consumerSecret: 'my appdata';
                                                                yourself);
                yourself).

No I tried in my browser
localhost:8100/sso-dropbox

Then I got a walkback in my Image: No secure socket stream class set or available

==>> I do not have the class ZdcSecureSocketStream in my Image
self secureSocketStreamClass is Nil in

streamClassForScheme: scheme
    (#(http ws) includes: scheme) ifTrue: [
        ^ self socketStreamClass ].
    (#(https wss) includes: scheme) ifTrue: [
        ^ self secureSocketStreamClass ifNil: [
            self error: 'No secure socket stream class set or available' ] ].
    (ZnUnknownScheme scheme: scheme) signal

Can you tell me what is missing to load?

Greetings
Sabine


30 January 2013 5:14:22.402 pm

ZnNetworkingUtils(Object)>>error:
    Receiver: a ZnNetworkingUtils
    Arguments and temporary variables:
        aString:     'No secure socket stream class set or available'
    Receiver's instance variables:
        socketStreamClass:     SocketStream
        secureSocketStreamClass:     nil

ZnNetworkingUtils>>streamClassForScheme:
    Receiver: a ZnNetworkingUtils
    Arguments and temporary variables:
        scheme:     #https
    Receiver's instance variables:
        socketStreamClass:     SocketStream
        secureSocketStreamClass:     nil

ZnNetworkingUtils>>socketStreamToUrlDirectly:
    Receiver: a ZnNetworkingUtils
    Arguments and temporary variables:
        url:     https://api.dropbox.com/1/oauth/request_token
        stream:     nil
        address:     #[199 47 218 158]
    Receiver's instance variables:
        socketStreamClass:     SocketStream
        secureSocketStreamClass:     nil

ZnNetworkingUtils>>socketStreamToUrl:
    Receiver: a ZnNetworkingUtils
    Arguments and temporary variables:
        url:     https://api.dropbox.com/1/oauth/request_token
    Receiver's instance variables:
        socketStreamClass:     SocketStream
        secureSocketStreamClass:     nil
 



On Wed, Jan 30, 2013 at 4:37 PM, Sven Van Caekenberghe <[hidden email]> wrote:
Sabine,

On 30 Jan 2013, at 16:24, Sabine Knöfel <[hidden email]> wrote:

> Hi Sven,
>
> after loading:
>
> Gofer it
>   url: 'http://mc.stfx.eu/ZincHTTPComponents';
>   package: 'ConfigurationOfZincHTTPComponents';
>   load.
>
> ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
>
> The ZnOAuth1ConsumerData does not have a method called >>newForDropbox (but >>newForGoogle and >>newForTwitter).
> Also, ZnSSOServerDelegate does not have a method >>dropboxData: (but facebook, twittter and google)
>
> Did I miss something?

Yes and no. The latest stable version of the configuration does not yet include the Dropbox code.
The following will load what is called bleedingEdge, the very latest version of everything, regardless of its release status.

  ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.

Sorry about that.

Sven

> Greetings
> Sabine
>
>
> On Sun, Jan 27, 2013 at 8:47 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>
> On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:
>
> > If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
>
> How to run the Dropbox code yourself:
>
> 1. Get yourself a free Dropbox account at http://www.dropbox.com
>
> 2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.
>
> 3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications
>
> 4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.
>
> 5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.
>
> 6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).
>
> Gofer it
>   url: 'http://mc.stfx.eu/ZincHTTPComponents';
>   package: 'ConfigurationOfZincHTTPComponents';
>   load.
>
> ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
>
> 7. Start a Zn server with an appropriate delegate, configured for your app
>
> (ZnServer startDefaultOn: 8100)
>         logToTranscript;
>         debugMode: true;
>         delegate: (ZnSSOServerDelegate new
>                 dropboxData: (ZnOAuth1ConsumerData newForDropbox
>                                                                 consumer: 'vqz-app-key-zoca';
>                                                                 consumerSecret: '13u-app-secret-8l006';
>                                                                 yourself);
>                 yourself).
>
> (The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).
>
> 8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.
>
> 9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.
>
> 10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.
>
> We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.
>
> As always, May the Source be with you!
>
> Sven
>
> PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.
>
> --
> Sven Van Caekenberghe
> http://stfx.eu
> Smalltalk is the Red Pill
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sven Van Caekenberghe-2

On 30 Jan 2013, at 17:21, Sabine Knöfel <[hidden email]> wrote:

> Hi Sven, hi Jan,
>
> thank you.
> I am one step further now but there must be something else missing to load.
> I failed with my current image, so I tried the following:
>
> I took a fresh image - the Pharo 1.4. one click app from the pharo homepage
> (http://gforge.inria.fr/frs/download.php/31258/Pharo-1.4-14557-OneClick.zip)
>
> Then I loaded seaside 3.0 (from the welcome screen - MetacelloConfigurationBrowser open).
>
> After that, I loaded
>
> Gofer it
>   url: 'http://mc.stfx.eu/ZincHTTPComponents';
>   package: 'ConfigurationOfZincHTTPComponents';
>   load.
>
> And then the bleeding Edge version
> ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
>
> Then this was possible:
> (ZnServer startDefaultOn: 8100)
>         logToTranscript;
>         debugMode: true;
>         delegate: (ZnSSOServerDelegate new
>                 dropboxData: (ZnOAuth1ConsumerData newForDropbox
>                                                                 consumer: 'my appdata';
>                                                                 consumerSecret: 'my appdata';
>                                                                 yourself);
>                 yourself).
>
> No I tried in my browser
> localhost:8100/sso-dropbox
>
> Then I got a walkback in my Image: No secure socket stream class set or available

Well, the error says it all: you need TLS/SSL support. As is noted in

  https://github.com/svenvc/docs/blob/master/zinc/zinc-sso-paper.md#installation

You can get Zodiac to work in 1.4

  http://zdc.stfx.eu

Don't forget that you also need the plugin next to your VM !

In Pharo 2.0 Zodiac is included by default the latest VM's there should have the plugin.
But in 2.0 it will be slightly more difficult to load Seaside, but it does work.

Sorry, but all this is still a bit in motion, hopefully you will keep trying.

> ==>> I do not have the class ZdcSecureSocketStream in my Image
> self secureSocketStreamClass is Nil in
>
> streamClassForScheme: scheme
>     (#(http ws) includes: scheme) ifTrue: [
>         ^ self socketStreamClass ].
>     (#(https wss) includes: scheme) ifTrue: [
>         ^ self secureSocketStreamClass ifNil: [
>             self error: 'No secure socket stream class set or available' ] ].
>     (ZnUnknownScheme scheme: scheme) signal
>
> Can you tell me what is missing to load?
>
> Greetings
> Sabine
>
>
> 30 January 2013 5:14:22.402 pm
>
> ZnNetworkingUtils(Object)>>error:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         aString:     'No secure socket stream class set or available'
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
> ZnNetworkingUtils>>streamClassForScheme:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         scheme:     #https
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
> ZnNetworkingUtils>>socketStreamToUrlDirectly:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         url:     https://api.dropbox.com/1/oauth/request_token
>         stream:     nil
>         address:     #[199 47 218 158]
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
> ZnNetworkingUtils>>socketStreamToUrl:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         url:     https://api.dropbox.com/1/oauth/request_token
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>  
>
>
>
> On Wed, Jan 30, 2013 at 4:37 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> Sabine,
>
> On 30 Jan 2013, at 16:24, Sabine Knöfel <[hidden email]> wrote:
>
> > Hi Sven,
> >
> > after loading:
> >
> > Gofer it
> >   url: 'http://mc.stfx.eu/ZincHTTPComponents';
> >   package: 'ConfigurationOfZincHTTPComponents';
> >   load.
> >
> > ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
> >
> > The ZnOAuth1ConsumerData does not have a method called >>newForDropbox (but >>newForGoogle and >>newForTwitter).
> > Also, ZnSSOServerDelegate does not have a method >>dropboxData: (but facebook, twittter and google)
> >
> > Did I miss something?
>
> Yes and no. The latest stable version of the configuration does not yet include the Dropbox code.
> The following will load what is called bleedingEdge, the very latest version of everything, regardless of its release status.
>
>   ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
>
> Sorry about that.
>
> Sven
>
> > Greetings
> > Sabine
> >
> >
> > On Sun, Jan 27, 2013 at 8:47 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> >
> > On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:
> >
> > > If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
> >
> > How to run the Dropbox code yourself:
> >
> > 1. Get yourself a free Dropbox account at http://www.dropbox.com
> >
> > 2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.
> >
> > 3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications
> >
> > 4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.
> >
> > 5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.
> >
> > 6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).
> >
> > Gofer it
> >   url: 'http://mc.stfx.eu/ZincHTTPComponents';
> >   package: 'ConfigurationOfZincHTTPComponents';
> >   load.
> >
> > ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
> >
> > 7. Start a Zn server with an appropriate delegate, configured for your app
> >
> > (ZnServer startDefaultOn: 8100)
> >         logToTranscript;
> >         debugMode: true;
> >         delegate: (ZnSSOServerDelegate new
> >                 dropboxData: (ZnOAuth1ConsumerData newForDropbox
> >                                                                 consumer: 'vqz-app-key-zoca';
> >                                                                 consumerSecret: '13u-app-secret-8l006';
> >                                                                 yourself);
> >                 yourself).
> >
> > (The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).
> >
> > 8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.
> >
> > 9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.
> >
> > 10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.
> >
> > We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.
> >
> > As always, May the Source be with you!
> >
> > Sven
> >
> > PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.
> >
> > --
> > Sven Van Caekenberghe
> > http://stfx.eu
> > Smalltalk is the Red Pill
> >
> >
> >
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sabine Manaa
Hi Sven,

there was only missing loading Zodiac, the dll (windows) was already included in the 1 klick image.

Gofer it
  squeaksource: 'Zodiac';
  package: 'Zodiac-Core';
  package: 'Zodiac-Tests';
  load.

It works. I play around now.
Thank you very much!
Sabine

On Wed, Jan 30, 2013 at 5:38 PM, Sven Van Caekenberghe <[hidden email]> wrote:

On 30 Jan 2013, at 17:21, Sabine Knöfel <[hidden email]> wrote:

> Hi Sven, hi Jan,
>
> thank you.
> I am one step further now but there must be something else missing to load.
> I failed with my current image, so I tried the following:
>
> I took a fresh image - the Pharo 1.4. one click app from the pharo homepage
> (http://gforge.inria.fr/frs/download.php/31258/Pharo-1.4-14557-OneClick.zip)
>
> Then I loaded seaside 3.0 (from the welcome screen - MetacelloConfigurationBrowser open).
>
> After that, I loaded
>
> Gofer it
>   url: 'http://mc.stfx.eu/ZincHTTPComponents';
>   package: 'ConfigurationOfZincHTTPComponents';
>   load.
>
> And then the bleeding Edge version
> ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
>
> Then this was possible:
> (ZnServer startDefaultOn: 8100)
>         logToTranscript;
>         debugMode: true;
>         delegate: (ZnSSOServerDelegate new
>                 dropboxData: (ZnOAuth1ConsumerData newForDropbox
>                                                                 consumer: 'my appdata';
>                                                                 consumerSecret: 'my appdata';
>                                                                 yourself);
>                 yourself).
>
> No I tried in my browser
> localhost:8100/sso-dropbox
>
> Then I got a walkback in my Image: No secure socket stream class set or available

Well, the error says it all: you need TLS/SSL support. As is noted in

  https://github.com/svenvc/docs/blob/master/zinc/zinc-sso-paper.md#installation

You can get Zodiac to work in 1.4

  http://zdc.stfx.eu

Don't forget that you also need the plugin next to your VM !

In Pharo 2.0 Zodiac is included by default the latest VM's there should have the plugin.
But in 2.0 it will be slightly more difficult to load Seaside, but it does work.

Sorry, but all this is still a bit in motion, hopefully you will keep trying.

> ==>> I do not have the class ZdcSecureSocketStream in my Image
> self secureSocketStreamClass is Nil in
>
> streamClassForScheme: scheme
>     (#(http ws) includes: scheme) ifTrue: [
>         ^ self socketStreamClass ].
>     (#(https wss) includes: scheme) ifTrue: [
>         ^ self secureSocketStreamClass ifNil: [
>             self error: 'No secure socket stream class set or available' ] ].
>     (ZnUnknownScheme scheme: scheme) signal
>
> Can you tell me what is missing to load?
>
> Greetings
> Sabine
>
>
> 30 January 2013 5:14:22.402 pm
>
> ZnNetworkingUtils(Object)>>error:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         aString:     'No secure socket stream class set or available'
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
> ZnNetworkingUtils>>streamClassForScheme:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         scheme:     #https
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
> ZnNetworkingUtils>>socketStreamToUrlDirectly:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         url:     https://api.dropbox.com/1/oauth/request_token
>         stream:     nil
>         address:     #[199 47 218 158]
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
> ZnNetworkingUtils>>socketStreamToUrl:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         url:     https://api.dropbox.com/1/oauth/request_token
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
>
>
>
> On Wed, Jan 30, 2013 at 4:37 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> Sabine,
>
> On 30 Jan 2013, at 16:24, Sabine Knöfel <[hidden email]> wrote:
>
> > Hi Sven,
> >
> > after loading:
> >
> > Gofer it
> >   url: 'http://mc.stfx.eu/ZincHTTPComponents';
> >   package: 'ConfigurationOfZincHTTPComponents';
> >   load.
> >
> > ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
> >
> > The ZnOAuth1ConsumerData does not have a method called >>newForDropbox (but >>newForGoogle and >>newForTwitter).
> > Also, ZnSSOServerDelegate does not have a method >>dropboxData: (but facebook, twittter and google)
> >
> > Did I miss something?
>
> Yes and no. The latest stable version of the configuration does not yet include the Dropbox code.
> The following will load what is called bleedingEdge, the very latest version of everything, regardless of its release status.
>
>   ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
>
> Sorry about that.
>
> Sven
>
> > Greetings
> > Sabine
> >
> >
> > On Sun, Jan 27, 2013 at 8:47 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> >
> > On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:
> >
> > > If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
> >
> > How to run the Dropbox code yourself:
> >
> > 1. Get yourself a free Dropbox account at http://www.dropbox.com
> >
> > 2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.
> >
> > 3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications
> >
> > 4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.
> >
> > 5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.
> >
> > 6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).
> >
> > Gofer it
> >   url: 'http://mc.stfx.eu/ZincHTTPComponents';
> >   package: 'ConfigurationOfZincHTTPComponents';
> >   load.
> >
> > ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
> >
> > 7. Start a Zn server with an appropriate delegate, configured for your app
> >
> > (ZnServer startDefaultOn: 8100)
> >         logToTranscript;
> >         debugMode: true;
> >         delegate: (ZnSSOServerDelegate new
> >                 dropboxData: (ZnOAuth1ConsumerData newForDropbox
> >                                                                 consumer: 'vqz-app-key-zoca';
> >                                                                 consumerSecret: '13u-app-secret-8l006';
> >                                                                 yourself);
> >                 yourself).
> >
> > (The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).
> >
> > 8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.
> >
> > 9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.
> >
> > 10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.
> >
> > We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.
> >
> > As always, May the Source be with you!
> >
> > Sven
> >
> > PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.
> >
> > --
> > Sven Van Caekenberghe
> > http://stfx.eu
> > Smalltalk is the Red Pill
> >
> >
> >
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sabine Manaa
Sven,

could you provide a simple code fragment which shows how to write and how to read a file from the smalltalk image to the connected dropbox app folder?

Greetings
Sabine

On Wed, Jan 30, 2013 at 6:00 PM, Sabine Knöfel <[hidden email]> wrote:
Hi Sven,

there was only missing loading Zodiac, the dll (windows) was already included in the 1 klick image.

Gofer it
  squeaksource: 'Zodiac';
  package: 'Zodiac-Core';
  package: 'Zodiac-Tests';
  load.

It works. I play around now.
Thank you very much!
Sabine


On Wed, Jan 30, 2013 at 5:38 PM, Sven Van Caekenberghe <[hidden email]> wrote:

On 30 Jan 2013, at 17:21, Sabine Knöfel <[hidden email]> wrote:

> Hi Sven, hi Jan,
>
> thank you.
> I am one step further now but there must be something else missing to load.
> I failed with my current image, so I tried the following:
>
> I took a fresh image - the Pharo 1.4. one click app from the pharo homepage
> (http://gforge.inria.fr/frs/download.php/31258/Pharo-1.4-14557-OneClick.zip)
>
> Then I loaded seaside 3.0 (from the welcome screen - MetacelloConfigurationBrowser open).
>
> After that, I loaded
>
> Gofer it
>   url: 'http://mc.stfx.eu/ZincHTTPComponents';
>   package: 'ConfigurationOfZincHTTPComponents';
>   load.
>
> And then the bleeding Edge version
> ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
>
> Then this was possible:
> (ZnServer startDefaultOn: 8100)
>         logToTranscript;
>         debugMode: true;
>         delegate: (ZnSSOServerDelegate new
>                 dropboxData: (ZnOAuth1ConsumerData newForDropbox
>                                                                 consumer: 'my appdata';
>                                                                 consumerSecret: 'my appdata';
>                                                                 yourself);
>                 yourself).
>
> No I tried in my browser
> localhost:8100/sso-dropbox
>
> Then I got a walkback in my Image: No secure socket stream class set or available

Well, the error says it all: you need TLS/SSL support. As is noted in

  https://github.com/svenvc/docs/blob/master/zinc/zinc-sso-paper.md#installation

You can get Zodiac to work in 1.4

  http://zdc.stfx.eu

Don't forget that you also need the plugin next to your VM !

In Pharo 2.0 Zodiac is included by default the latest VM's there should have the plugin.
But in 2.0 it will be slightly more difficult to load Seaside, but it does work.

Sorry, but all this is still a bit in motion, hopefully you will keep trying.

> ==>> I do not have the class ZdcSecureSocketStream in my Image
> self secureSocketStreamClass is Nil in
>
> streamClassForScheme: scheme
>     (#(http ws) includes: scheme) ifTrue: [
>         ^ self socketStreamClass ].
>     (#(https wss) includes: scheme) ifTrue: [
>         ^ self secureSocketStreamClass ifNil: [
>             self error: 'No secure socket stream class set or available' ] ].
>     (ZnUnknownScheme scheme: scheme) signal
>
> Can you tell me what is missing to load?
>
> Greetings
> Sabine
>
>
> 30 January 2013 5:14:22.402 pm
>
> ZnNetworkingUtils(Object)>>error:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         aString:     'No secure socket stream class set or available'
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
> ZnNetworkingUtils>>streamClassForScheme:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         scheme:     #https
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
> ZnNetworkingUtils>>socketStreamToUrlDirectly:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         url:     https://api.dropbox.com/1/oauth/request_token
>         stream:     nil
>         address:     #[199 47 218 158]
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
> ZnNetworkingUtils>>socketStreamToUrl:
>     Receiver: a ZnNetworkingUtils
>     Arguments and temporary variables:
>         url:     https://api.dropbox.com/1/oauth/request_token
>     Receiver's instance variables:
>         socketStreamClass:     SocketStream
>         secureSocketStreamClass:     nil
>
>
>
>
> On Wed, Jan 30, 2013 at 4:37 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> Sabine,
>
> On 30 Jan 2013, at 16:24, Sabine Knöfel <[hidden email]> wrote:
>
> > Hi Sven,
> >
> > after loading:
> >
> > Gofer it
> >   url: 'http://mc.stfx.eu/ZincHTTPComponents';
> >   package: 'ConfigurationOfZincHTTPComponents';
> >   load.
> >
> > ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
> >
> > The ZnOAuth1ConsumerData does not have a method called >>newForDropbox (but >>newForGoogle and >>newForTwitter).
> > Also, ZnSSOServerDelegate does not have a method >>dropboxData: (but facebook, twittter and google)
> >
> > Did I miss something?
>
> Yes and no. The latest stable version of the configuration does not yet include the Dropbox code.
> The following will load what is called bleedingEdge, the very latest version of everything, regardless of its release status.
>
>   ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
>
> Sorry about that.
>
> Sven
>
> > Greetings
> > Sabine
> >
> >
> > On Sun, Jan 27, 2013 at 8:47 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> >
> > On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:
> >
> > > If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
> >
> > How to run the Dropbox code yourself:
> >
> > 1. Get yourself a free Dropbox account at http://www.dropbox.com
> >
> > 2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.
> >
> > 3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications
> >
> > 4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.
> >
> > 5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.
> >
> > 6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).
> >
> > Gofer it
> >   url: 'http://mc.stfx.eu/ZincHTTPComponents';
> >   package: 'ConfigurationOfZincHTTPComponents';
> >   load.
> >
> > ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
> >
> > 7. Start a Zn server with an appropriate delegate, configured for your app
> >
> > (ZnServer startDefaultOn: 8100)
> >         logToTranscript;
> >         debugMode: true;
> >         delegate: (ZnSSOServerDelegate new
> >                 dropboxData: (ZnOAuth1ConsumerData newForDropbox
> >                                                                 consumer: 'vqz-app-key-zoca';
> >                                                                 consumerSecret: '13u-app-secret-8l006';
> >                                                                 yourself);
> >                 yourself).
> >
> > (The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).
> >
> > 8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.
> >
> > 9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.
> >
> > 10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.
> >
> > We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.
> >
> > As always, May the Source be with you!
> >
> > Sven
> >
> > PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.
> >
> > --
> > Sven Van Caekenberghe
> > http://stfx.eu
> > Smalltalk is the Red Pill
> >
> >
> >
>
>
>




Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sven Van Caekenberghe-2

On 30 Jan 2013, at 18:32, Sabine Knöfel <[hidden email]> wrote:

> Sven,
>
> could you provide a simple code fragment which shows how to write and how to read a file from the smalltalk image to the connected dropbox app folder?

The whole API is not (yet) implemented.

  https://www.dropbox.com/developers/reference/api

Have a look at ZnOAuth1TwitterUserAccess.

If I find more time, I might try myself.

GET is pretty straightforward, for PUT or POST you will have to supply a ZnEntity of a specific mime-type with bytes or a string.
 
Note that for file access the host is different.

> Greetings
> Sabine
>
> On Wed, Jan 30, 2013 at 6:00 PM, Sabine Knöfel <[hidden email]> wrote:
> Hi Sven,
>
> there was only missing loading Zodiac, the dll (windows) was already included in the 1 klick image.
>
> Gofer it
>   squeaksource: 'Zodiac';
>   package: 'Zodiac-Core';
>   package: 'Zodiac-Tests';
>   load.
>
> It works. I play around now.
> Thank you very much!
> Sabine
>
>
> On Wed, Jan 30, 2013 at 5:38 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>
> On 30 Jan 2013, at 17:21, Sabine Knöfel <[hidden email]> wrote:
>
> > Hi Sven, hi Jan,
> >
> > thank you.
> > I am one step further now but there must be something else missing to load.
> > I failed with my current image, so I tried the following:
> >
> > I took a fresh image - the Pharo 1.4. one click app from the pharo homepage
> > (http://gforge.inria.fr/frs/download.php/31258/Pharo-1.4-14557-OneClick.zip)
> >
> > Then I loaded seaside 3.0 (from the welcome screen - MetacelloConfigurationBrowser open).
> >
> > After that, I loaded
> >
> > Gofer it
> >   url: 'http://mc.stfx.eu/ZincHTTPComponents';
> >   package: 'ConfigurationOfZincHTTPComponents';
> >   load.
> >
> > And then the bleeding Edge version
> > ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
> >
> > Then this was possible:
> > (ZnServer startDefaultOn: 8100)
> >         logToTranscript;
> >         debugMode: true;
> >         delegate: (ZnSSOServerDelegate new
> >                 dropboxData: (ZnOAuth1ConsumerData newForDropbox
> >                                                                 consumer: 'my appdata';
> >                                                                 consumerSecret: 'my appdata';
> >                                                                 yourself);
> >                 yourself).
> >
> > No I tried in my browser
> > localhost:8100/sso-dropbox
> >
> > Then I got a walkback in my Image: No secure socket stream class set or available
>
> Well, the error says it all: you need TLS/SSL support. As is noted in
>
>   https://github.com/svenvc/docs/blob/master/zinc/zinc-sso-paper.md#installation
>
> You can get Zodiac to work in 1.4
>
>   http://zdc.stfx.eu
>
> Don't forget that you also need the plugin next to your VM !
>
> In Pharo 2.0 Zodiac is included by default the latest VM's there should have the plugin.
> But in 2.0 it will be slightly more difficult to load Seaside, but it does work.
>
> Sorry, but all this is still a bit in motion, hopefully you will keep trying.
>
> > ==>> I do not have the class ZdcSecureSocketStream in my Image
> > self secureSocketStreamClass is Nil in
> >
> > streamClassForScheme: scheme
> >     (#(http ws) includes: scheme) ifTrue: [
> >         ^ self socketStreamClass ].
> >     (#(https wss) includes: scheme) ifTrue: [
> >         ^ self secureSocketStreamClass ifNil: [
> >             self error: 'No secure socket stream class set or available' ] ].
> >     (ZnUnknownScheme scheme: scheme) signal
> >
> > Can you tell me what is missing to load?
> >
> > Greetings
> > Sabine
> >
> >
> > 30 January 2013 5:14:22.402 pm
> >
> > ZnNetworkingUtils(Object)>>error:
> >     Receiver: a ZnNetworkingUtils
> >     Arguments and temporary variables:
> >         aString:     'No secure socket stream class set or available'
> >     Receiver's instance variables:
> >         socketStreamClass:     SocketStream
> >         secureSocketStreamClass:     nil
> >
> > ZnNetworkingUtils>>streamClassForScheme:
> >     Receiver: a ZnNetworkingUtils
> >     Arguments and temporary variables:
> >         scheme:     #https
> >     Receiver's instance variables:
> >         socketStreamClass:     SocketStream
> >         secureSocketStreamClass:     nil
> >
> > ZnNetworkingUtils>>socketStreamToUrlDirectly:
> >     Receiver: a ZnNetworkingUtils
> >     Arguments and temporary variables:
> >         url:     https://api.dropbox.com/1/oauth/request_token
> >         stream:     nil
> >         address:     #[199 47 218 158]
> >     Receiver's instance variables:
> >         socketStreamClass:     SocketStream
> >         secureSocketStreamClass:     nil
> >
> > ZnNetworkingUtils>>socketStreamToUrl:
> >     Receiver: a ZnNetworkingUtils
> >     Arguments and temporary variables:
> >         url:     https://api.dropbox.com/1/oauth/request_token
> >     Receiver's instance variables:
> >         socketStreamClass:     SocketStream
> >         secureSocketStreamClass:     nil
> >
> >
> >
> >
> > On Wed, Jan 30, 2013 at 4:37 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> > Sabine,
> >
> > On 30 Jan 2013, at 16:24, Sabine Knöfel <[hidden email]> wrote:
> >
> > > Hi Sven,
> > >
> > > after loading:
> > >
> > > Gofer it
> > >   url: 'http://mc.stfx.eu/ZincHTTPComponents';
> > >   package: 'ConfigurationOfZincHTTPComponents';
> > >   load.
> > >
> > > ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
> > >
> > > The ZnOAuth1ConsumerData does not have a method called >>newForDropbox (but >>newForGoogle and >>newForTwitter).
> > > Also, ZnSSOServerDelegate does not have a method >>dropboxData: (but facebook, twittter and google)
> > >
> > > Did I miss something?
> >
> > Yes and no. The latest stable version of the configuration does not yet include the Dropbox code.
> > The following will load what is called bleedingEdge, the very latest version of everything, regardless of its release status.
> >
> >   ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
> >
> > Sorry about that.
> >
> > Sven
> >
> > > Greetings
> > > Sabine
> > >
> > >
> > > On Sun, Jan 27, 2013 at 8:47 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> > >
> > > On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:
> > >
> > > > If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
> > >
> > > How to run the Dropbox code yourself:
> > >
> > > 1. Get yourself a free Dropbox account at http://www.dropbox.com
> > >
> > > 2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.
> > >
> > > 3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications
> > >
> > > 4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.
> > >
> > > 5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.
> > >
> > > 6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).
> > >
> > > Gofer it
> > >   url: 'http://mc.stfx.eu/ZincHTTPComponents';
> > >   package: 'ConfigurationOfZincHTTPComponents';
> > >   load.
> > >
> > > ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
> > >
> > > 7. Start a Zn server with an appropriate delegate, configured for your app
> > >
> > > (ZnServer startDefaultOn: 8100)
> > >         logToTranscript;
> > >         debugMode: true;
> > >         delegate: (ZnSSOServerDelegate new
> > >                 dropboxData: (ZnOAuth1ConsumerData newForDropbox
> > >                                                                 consumer: 'vqz-app-key-zoca';
> > >                                                                 consumerSecret: '13u-app-secret-8l006';
> > >                                                                 yourself);
> > >                 yourself).
> > >
> > > (The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).
> > >
> > > 8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.
> > >
> > > 9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.
> > >
> > > 10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.
> > >
> > > We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.
> > >
> > > As always, May the Source be with you!
> > >
> > > Sven
> > >
> > > PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.
> > >
> > > --
> > > Sven Van Caekenberghe
> > > http://stfx.eu
> > > Smalltalk is the Red Pill
> > >
> > >
> > >
> >
> >
> >
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sven Van Caekenberghe-2

On 30 Jan 2013, at 19:13, Sven Van Caekenberghe <[hidden email]> wrote:

> On 30 Jan 2013, at 18:32, Sabine Knöfel <[hidden email]> wrote:
>
>> Sven,
>>
>> could you provide a simple code fragment which shows how to write and how to read a file from the smalltalk image to the connected dropbox app folder?
>
> The whole API is not (yet) implemented.
>
>  https://www.dropbox.com/developers/reference/api
>
> Have a look at ZnOAuth1TwitterUserAccess.
>
> If I find more time, I might try myself.
>
> GET is pretty straightforward, for PUT or POST you will have to supply a ZnEntity of a specific mime-type with bytes or a string.
>
> Note that for file access the host is different.

I added a bit more Dropbox API and a little demo accessing files.

There is now #manipulateDemoFile: which will try to access a file called 'demo.txt' and read an id out of it. If found the file is written again, with the id increased and some other fields updated as well. If the file did not exist, it is created with id 1. All this happens automatically if you access /sso-dropbox and log in. You'll get the updated id in the web page and you'll see your Dropbox client doing a local update immediately!

Here are the details (http://mc.stfx.eu/Zinc-HTTP-Components):

---
Name: Zinc-SSO-OAuth1-Core-SvenVanCaekenberghe.13
Author: SvenVanCaekenberghe
Time: 4 February 2013, 12:27:12.196 pm
UUID: 3d78a965-462e-4a4e-94aa-1779369aecb8
Ancestors: Zinc-SSO-OAuth1-Core-SvenVanCaekenberghe.12

extended ZnOAuth1Service with #httpDelete:using: #httpPost:with:using: #httpPut:with:using:
extended ZnOAuth1DropboxUserAccess with #getFile: and #putFile:data:
some refactoring in ZnOAuth1DropboxUserAccess
---
Name: Zinc-SSO-Demo-SvenVanCaekenberghe.5
Author: SvenVanCaekenberghe
Time: 4 February 2013, 12:28:14.601 pm
UUID: 4bb17785-f885-4db5-98f5-9c7d52d3add6
Ancestors: Zinc-SSO-Demo-SvenVanCaekenberghe.4

added ZnSSOServerDelegate>>#manipulateDemoFile:
---

This should get you started.

Note that it is not necessary to log in each time: the access token is valid until you get an unauthorized response.
With the access token and the consumer data you can create service objects separate from the web app that did the setup.

HTH,

Sven


>> Greetings
>> Sabine
>>
>> On Wed, Jan 30, 2013 at 6:00 PM, Sabine Knöfel <[hidden email]> wrote:
>> Hi Sven,
>>
>> there was only missing loading Zodiac, the dll (windows) was already included in the 1 klick image.
>>
>> Gofer it
>>  squeaksource: 'Zodiac';
>>  package: 'Zodiac-Core';
>>  package: 'Zodiac-Tests';
>>  load.
>>
>> It works. I play around now.
>> Thank you very much!
>> Sabine
>>
>>
>> On Wed, Jan 30, 2013 at 5:38 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>> On 30 Jan 2013, at 17:21, Sabine Knöfel <[hidden email]> wrote:
>>
>>> Hi Sven, hi Jan,
>>>
>>> thank you.
>>> I am one step further now but there must be something else missing to load.
>>> I failed with my current image, so I tried the following:
>>>
>>> I took a fresh image - the Pharo 1.4. one click app from the pharo homepage
>>> (http://gforge.inria.fr/frs/download.php/31258/Pharo-1.4-14557-OneClick.zip)
>>>
>>> Then I loaded seaside 3.0 (from the welcome screen - MetacelloConfigurationBrowser open).
>>>
>>> After that, I loaded
>>>
>>> Gofer it
>>>  url: 'http://mc.stfx.eu/ZincHTTPComponents';
>>>  package: 'ConfigurationOfZincHTTPComponents';
>>>  load.
>>>
>>> And then the bleeding Edge version
>>> ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
>>>
>>> Then this was possible:
>>> (ZnServer startDefaultOn: 8100)
>>>        logToTranscript;
>>>        debugMode: true;
>>>        delegate: (ZnSSOServerDelegate new
>>>                dropboxData: (ZnOAuth1ConsumerData newForDropbox
>>>                                                                consumer: 'my appdata';
>>>                                                                consumerSecret: 'my appdata';
>>>                                                                yourself);
>>>                yourself).
>>>
>>> No I tried in my browser
>>> localhost:8100/sso-dropbox
>>>
>>> Then I got a walkback in my Image: No secure socket stream class set or available
>>
>> Well, the error says it all: you need TLS/SSL support. As is noted in
>>
>>  https://github.com/svenvc/docs/blob/master/zinc/zinc-sso-paper.md#installation
>>
>> You can get Zodiac to work in 1.4
>>
>>  http://zdc.stfx.eu
>>
>> Don't forget that you also need the plugin next to your VM !
>>
>> In Pharo 2.0 Zodiac is included by default the latest VM's there should have the plugin.
>> But in 2.0 it will be slightly more difficult to load Seaside, but it does work.
>>
>> Sorry, but all this is still a bit in motion, hopefully you will keep trying.
>>
>>> ==>> I do not have the class ZdcSecureSocketStream in my Image
>>> self secureSocketStreamClass is Nil in
>>>
>>> streamClassForScheme: scheme
>>>    (#(http ws) includes: scheme) ifTrue: [
>>>        ^ self socketStreamClass ].
>>>    (#(https wss) includes: scheme) ifTrue: [
>>>        ^ self secureSocketStreamClass ifNil: [
>>>            self error: 'No secure socket stream class set or available' ] ].
>>>    (ZnUnknownScheme scheme: scheme) signal
>>>
>>> Can you tell me what is missing to load?
>>>
>>> Greetings
>>> Sabine
>>>
>>>
>>> 30 January 2013 5:14:22.402 pm
>>>
>>> ZnNetworkingUtils(Object)>>error:
>>>    Receiver: a ZnNetworkingUtils
>>>    Arguments and temporary variables:
>>>        aString:     'No secure socket stream class set or available'
>>>    Receiver's instance variables:
>>>        socketStreamClass:     SocketStream
>>>        secureSocketStreamClass:     nil
>>>
>>> ZnNetworkingUtils>>streamClassForScheme:
>>>    Receiver: a ZnNetworkingUtils
>>>    Arguments and temporary variables:
>>>        scheme:     #https
>>>    Receiver's instance variables:
>>>        socketStreamClass:     SocketStream
>>>        secureSocketStreamClass:     nil
>>>
>>> ZnNetworkingUtils>>socketStreamToUrlDirectly:
>>>    Receiver: a ZnNetworkingUtils
>>>    Arguments and temporary variables:
>>>        url:     https://api.dropbox.com/1/oauth/request_token
>>>        stream:     nil
>>>        address:     #[199 47 218 158]
>>>    Receiver's instance variables:
>>>        socketStreamClass:     SocketStream
>>>        secureSocketStreamClass:     nil
>>>
>>> ZnNetworkingUtils>>socketStreamToUrl:
>>>    Receiver: a ZnNetworkingUtils
>>>    Arguments and temporary variables:
>>>        url:     https://api.dropbox.com/1/oauth/request_token
>>>    Receiver's instance variables:
>>>        socketStreamClass:     SocketStream
>>>        secureSocketStreamClass:     nil
>>>
>>>
>>>
>>>
>>> On Wed, Jan 30, 2013 at 4:37 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>> Sabine,
>>>
>>> On 30 Jan 2013, at 16:24, Sabine Knöfel <[hidden email]> wrote:
>>>
>>>> Hi Sven,
>>>>
>>>> after loading:
>>>>
>>>> Gofer it
>>>>  url: 'http://mc.stfx.eu/ZincHTTPComponents';
>>>>  package: 'ConfigurationOfZincHTTPComponents';
>>>>  load.
>>>>
>>>> ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
>>>>
>>>> The ZnOAuth1ConsumerData does not have a method called >>newForDropbox (but >>newForGoogle and >>newForTwitter).
>>>> Also, ZnSSOServerDelegate does not have a method >>dropboxData: (but facebook, twittter and google)
>>>>
>>>> Did I miss something?
>>>
>>> Yes and no. The latest stable version of the configuration does not yet include the Dropbox code.
>>> The following will load what is called bleedingEdge, the very latest version of everything, regardless of its release status.
>>>
>>>  ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
>>>
>>> Sorry about that.
>>>
>>> Sven
>>>
>>>> Greetings
>>>> Sabine
>>>>
>>>>
>>>> On Sun, Jan 27, 2013 at 8:47 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>>>
>>>> On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:
>>>>
>>>>> If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
>>>>
>>>> How to run the Dropbox code yourself:
>>>>
>>>> 1. Get yourself a free Dropbox account at http://www.dropbox.com
>>>>
>>>> 2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.
>>>>
>>>> 3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications
>>>>
>>>> 4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.
>>>>
>>>> 5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.
>>>>
>>>> 6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).
>>>>
>>>> Gofer it
>>>>  url: 'http://mc.stfx.eu/ZincHTTPComponents';
>>>>  package: 'ConfigurationOfZincHTTPComponents';
>>>>  load.
>>>>
>>>> ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
>>>>
>>>> 7. Start a Zn server with an appropriate delegate, configured for your app
>>>>
>>>> (ZnServer startDefaultOn: 8100)
>>>>        logToTranscript;
>>>>        debugMode: true;
>>>>        delegate: (ZnSSOServerDelegate new
>>>>                dropboxData: (ZnOAuth1ConsumerData newForDropbox
>>>>                                                                consumer: 'vqz-app-key-zoca';
>>>>                                                                consumerSecret: '13u-app-secret-8l006';
>>>>                                                                yourself);
>>>>                yourself).
>>>>
>>>> (The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).
>>>>
>>>> 8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.
>>>>
>>>> 9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.
>>>>
>>>> 10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.
>>>>
>>>> We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.
>>>>
>>>> As always, May the Source be with you!
>>>>
>>>> Sven
>>>>
>>>> PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.
>>>>
>>>> --
>>>> Sven Van Caekenberghe
>>>> http://stfx.eu
>>>> Smalltalk is the Red Pill
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Update] Zinc-SSO now supports Dropbox !

Sabine Manaa
Hi Sven,

great! The file was created in my dropbox account:-)
I will try to use it now in my application and will come back with questions if they occur.
Thank you very much.

Sabine

On Mon, Feb 4, 2013 at 12:52 PM, Sven Van Caekenberghe <[hidden email]> wrote:

On 30 Jan 2013, at 19:13, Sven Van Caekenberghe <[hidden email]> wrote:

> On 30 Jan 2013, at 18:32, Sabine Knöfel <[hidden email]> wrote:
>
>> Sven,
>>
>> could you provide a simple code fragment which shows how to write and how to read a file from the smalltalk image to the connected dropbox app folder?
>
> The whole API is not (yet) implemented.
>
>  https://www.dropbox.com/developers/reference/api
>
> Have a look at ZnOAuth1TwitterUserAccess.
>
> If I find more time, I might try myself.
>
> GET is pretty straightforward, for PUT or POST you will have to supply a ZnEntity of a specific mime-type with bytes or a string.
>
> Note that for file access the host is different.

I added a bit more Dropbox API and a little demo accessing files.

There is now #manipulateDemoFile: which will try to access a file called 'demo.txt' and read an id out of it. If found the file is written again, with the id increased and some other fields updated as well. If the file did not exist, it is created with id 1. All this happens automatically if you access /sso-dropbox and log in. You'll get the updated id in the web page and you'll see your Dropbox client doing a local update immediately!

Here are the details (http://mc.stfx.eu/Zinc-HTTP-Components):

---
Name: Zinc-SSO-OAuth1-Core-SvenVanCaekenberghe.13
Author: SvenVanCaekenberghe
Time: 4 February 2013, 12:27:12.196 pm
UUID: 3d78a965-462e-4a4e-94aa-1779369aecb8
Ancestors: Zinc-SSO-OAuth1-Core-SvenVanCaekenberghe.12

extended ZnOAuth1Service with #httpDelete:using: #httpPost:with:using: #httpPut:with:using:
extended ZnOAuth1DropboxUserAccess with #getFile: and #putFile:data:
some refactoring in ZnOAuth1DropboxUserAccess
---
Name: Zinc-SSO-Demo-SvenVanCaekenberghe.5
Author: SvenVanCaekenberghe
Time: 4 February 2013, 12:28:14.601 pm
UUID: 4bb17785-f885-4db5-98f5-9c7d52d3add6
Ancestors: Zinc-SSO-Demo-SvenVanCaekenberghe.4

added ZnSSOServerDelegate>>#manipulateDemoFile:
---

This should get you started.

Note that it is not necessary to log in each time: the access token is valid until you get an unauthorized response.
With the access token and the consumer data you can create service objects separate from the web app that did the setup.

HTH,

Sven


>> Greetings
>> Sabine
>>
>> On Wed, Jan 30, 2013 at 6:00 PM, Sabine Knöfel <[hidden email]> wrote:
>> Hi Sven,
>>
>> there was only missing loading Zodiac, the dll (windows) was already included in the 1 klick image.
>>
>> Gofer it
>>  squeaksource: 'Zodiac';
>>  package: 'Zodiac-Core';
>>  package: 'Zodiac-Tests';
>>  load.
>>
>> It works. I play around now.
>> Thank you very much!
>> Sabine
>>
>>
>> On Wed, Jan 30, 2013 at 5:38 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>> On 30 Jan 2013, at 17:21, Sabine Knöfel <[hidden email]> wrote:
>>
>>> Hi Sven, hi Jan,
>>>
>>> thank you.
>>> I am one step further now but there must be something else missing to load.
>>> I failed with my current image, so I tried the following:
>>>
>>> I took a fresh image - the Pharo 1.4. one click app from the pharo homepage
>>> (http://gforge.inria.fr/frs/download.php/31258/Pharo-1.4-14557-OneClick.zip)
>>>
>>> Then I loaded seaside 3.0 (from the welcome screen - MetacelloConfigurationBrowser open).
>>>
>>> After that, I loaded
>>>
>>> Gofer it
>>>  url: 'http://mc.stfx.eu/ZincHTTPComponents';
>>>  package: 'ConfigurationOfZincHTTPComponents';
>>>  load.
>>>
>>> And then the bleeding Edge version
>>> ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
>>>
>>> Then this was possible:
>>> (ZnServer startDefaultOn: 8100)
>>>        logToTranscript;
>>>        debugMode: true;
>>>        delegate: (ZnSSOServerDelegate new
>>>                dropboxData: (ZnOAuth1ConsumerData newForDropbox
>>>                                                                consumer: 'my appdata';
>>>                                                                consumerSecret: 'my appdata';
>>>                                                                yourself);
>>>                yourself).
>>>
>>> No I tried in my browser
>>> localhost:8100/sso-dropbox
>>>
>>> Then I got a walkback in my Image: No secure socket stream class set or available
>>
>> Well, the error says it all: you need TLS/SSL support. As is noted in
>>
>>  https://github.com/svenvc/docs/blob/master/zinc/zinc-sso-paper.md#installation
>>
>> You can get Zodiac to work in 1.4
>>
>>  http://zdc.stfx.eu
>>
>> Don't forget that you also need the plugin next to your VM !
>>
>> In Pharo 2.0 Zodiac is included by default the latest VM's there should have the plugin.
>> But in 2.0 it will be slightly more difficult to load Seaside, but it does work.
>>
>> Sorry, but all this is still a bit in motion, hopefully you will keep trying.
>>
>>> ==>> I do not have the class ZdcSecureSocketStream in my Image
>>> self secureSocketStreamClass is Nil in
>>>
>>> streamClassForScheme: scheme
>>>    (#(http ws) includes: scheme) ifTrue: [
>>>        ^ self socketStreamClass ].
>>>    (#(https wss) includes: scheme) ifTrue: [
>>>        ^ self secureSocketStreamClass ifNil: [
>>>            self error: 'No secure socket stream class set or available' ] ].
>>>    (ZnUnknownScheme scheme: scheme) signal
>>>
>>> Can you tell me what is missing to load?
>>>
>>> Greetings
>>> Sabine
>>>
>>>
>>> 30 January 2013 5:14:22.402 pm
>>>
>>> ZnNetworkingUtils(Object)>>error:
>>>    Receiver: a ZnNetworkingUtils
>>>    Arguments and temporary variables:
>>>        aString:     'No secure socket stream class set or available'
>>>    Receiver's instance variables:
>>>        socketStreamClass:     SocketStream
>>>        secureSocketStreamClass:     nil
>>>
>>> ZnNetworkingUtils>>streamClassForScheme:
>>>    Receiver: a ZnNetworkingUtils
>>>    Arguments and temporary variables:
>>>        scheme:     #https
>>>    Receiver's instance variables:
>>>        socketStreamClass:     SocketStream
>>>        secureSocketStreamClass:     nil
>>>
>>> ZnNetworkingUtils>>socketStreamToUrlDirectly:
>>>    Receiver: a ZnNetworkingUtils
>>>    Arguments and temporary variables:
>>>        url:     https://api.dropbox.com/1/oauth/request_token
>>>        stream:     nil
>>>        address:     #[199 47 218 158]
>>>    Receiver's instance variables:
>>>        socketStreamClass:     SocketStream
>>>        secureSocketStreamClass:     nil
>>>
>>> ZnNetworkingUtils>>socketStreamToUrl:
>>>    Receiver: a ZnNetworkingUtils
>>>    Arguments and temporary variables:
>>>        url:     https://api.dropbox.com/1/oauth/request_token
>>>    Receiver's instance variables:
>>>        socketStreamClass:     SocketStream
>>>        secureSocketStreamClass:     nil
>>>
>>>
>>>
>>>
>>> On Wed, Jan 30, 2013 at 4:37 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>> Sabine,
>>>
>>> On 30 Jan 2013, at 16:24, Sabine Knöfel <[hidden email]> wrote:
>>>
>>>> Hi Sven,
>>>>
>>>> after loading:
>>>>
>>>> Gofer it
>>>>  url: 'http://mc.stfx.eu/ZincHTTPComponents';
>>>>  package: 'ConfigurationOfZincHTTPComponents';
>>>>  load.
>>>>
>>>> ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
>>>>
>>>> The ZnOAuth1ConsumerData does not have a method called >>newForDropbox (but >>newForGoogle and >>newForTwitter).
>>>> Also, ZnSSOServerDelegate does not have a method >>dropboxData: (but facebook, twittter and google)
>>>>
>>>> Did I miss something?
>>>
>>> Yes and no. The latest stable version of the configuration does not yet include the Dropbox code.
>>> The following will load what is called bleedingEdge, the very latest version of everything, regardless of its release status.
>>>
>>>  ConfigurationOfZincHTTPComponents project bleedingEdge load: 'SSO'.
>>>
>>> Sorry about that.
>>>
>>> Sven
>>>
>>>> Greetings
>>>> Sabine
>>>>
>>>>
>>>> On Sun, Jan 27, 2013 at 8:47 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>>>
>>>> On 27 Jan 2013, at 13:32, Sven Van Caekenberghe <[hidden email]> wrote:
>>>>
>>>>> If anyone is interested, I can write another email explaining how you can run this demo for yourself on your own account.
>>>>
>>>> How to run the Dropbox code yourself:
>>>>
>>>> 1. Get yourself a free Dropbox account at http://www.dropbox.com
>>>>
>>>> 2. Install some client software on one or more of your computers (Mac, Windows, Linux) or devices (iOS [iPhone, iPad, iPod], Android, BlackBerry, Kindle Fire) and move some files around to get a feel for the service.
>>>>
>>>> 3. When you give other applications access to (part of) your Dropbox files, you can check that at https://www.dropbox.com/account#applications
>>>>
>>>> 4. Define your own app that will try to access Dropbox files. Go to https://www.dropbox.com/developers (Developer home) and start defining a new app by clicking the 'Create an app' button at https://www.dropbox.com/developers/apps - start with the access type 'App folder'.
>>>>
>>>> 5. The two important elements you need are the 'App key' and 'App secret', make sure to copy them correctly.
>>>>
>>>> 6. Get the very latest code in your image (we develop in Pharo 2.0, but 1.4 or even 1.3 should work - SSL has to be fully operational).
>>>>
>>>> Gofer it
>>>>  url: 'http://mc.stfx.eu/ZincHTTPComponents';
>>>>  package: 'ConfigurationOfZincHTTPComponents';
>>>>  load.
>>>>
>>>> ConfigurationOfZincHTTPComponents project latestVersion load: 'SSO'.
>>>>
>>>> 7. Start a Zn server with an appropriate delegate, configured for your app
>>>>
>>>> (ZnServer startDefaultOn: 8100)
>>>>        logToTranscript;
>>>>        debugMode: true;
>>>>        delegate: (ZnSSOServerDelegate new
>>>>                dropboxData: (ZnOAuth1ConsumerData newForDropbox
>>>>                                                                consumer: 'vqz-app-key-zoca';
>>>>                                                                consumerSecret: '13u-app-secret-8l006';
>>>>                                                                yourself);
>>>>                yourself).
>>>>
>>>> (The above is a demo setup limited to Dropbox, the other demos are not configured and won't work).
>>>>
>>>> 8. Go to http:://localhost:8100/sso-dropbox and click the link to log in - you will be transferred to Dropbox to log in (if you aren't already) and asked to authorise your demo app, after which Dropbox will redirect you back to your app.
>>>>
>>>> 9. Once back in your app, sso-dropbox-callback (#ssoDropboxCallback:) will access your account info and list the app root folder, which will then be shown.
>>>>
>>>> 10. For the rest of the API, (currently not yet implemented), see https://www.dropbox.com/developers/reference/api - you don't have to worry about the whole authentication thanks to Zinc-SSO.
>>>>
>>>> We would love for others to try this (as well as the other Zinc-SSO options, Google, Facebook, Twitter) out, in their own projects, and to provide actual feedback and generally help improve the code and documentation.
>>>>
>>>> As always, May the Source be with you!
>>>>
>>>> Sven
>>>>
>>>> PS: The demo app is not (yet) a production app: only you and up to 5 explicitly listed users can use it. You have to apply for production status later on. Also, the whole ZnSSOServerDelegate code is a demo, for an actual project, it would be best to extract the necessary parts out of it, reusing the underlying Zinc-SSO-OAuth1-Core framework.
>>>>
>>>> --
>>>> Sven Van Caekenberghe
>>>> http://stfx.eu
>>>> Smalltalk is the Red Pill
>>>>
>>>>

12