<commit_before># Passport-Odesk

[Passport](http://passportjs.org/) strategy for authenticating with [Odesk](https://www.odesk.com/)
using the OAuth 1.0a API.

This module lets you authenticate using Odesk in your Node.js applications.
By plugging into Passport, Odesk authentication can be easily and
unobtrusively integrated into any application or framework that supports
[Connect](http://www.senchalabs.org/connect/)-style middleware, including
[Express](http://expressjs.com/).

## Install

    $ npm install passport-odesk

## Usage

#### Configure Strategy

We need to get this keyes from odesk api. I think the odesk team knows it better,
As for me, i was simply provided with this dada

    passport.use(new OdeskStrategy({
        consumerKey: '<KEY>',
        consumerSecret: '<KEY>',
        callbackURL: "http://127.0.0.1:3000/auth/odesk/callback"
      },
      function(token, tokenSecret, profile, done) {
        User.findOrCreate({ id: profile._id }, function (err, user) {
          return done(err, user);
        });
      }
    ));

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'odesk'` strategy, to
authenticate requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application:

    app.get('/auth/odesk',
      passport.authenticate('odesk'));
    
    app.get('/auth/odesk/callback',
      passport.authenticate('odesk', { failureRedirect: '/login' }),
      function(req, res) {
        // Successful authentication, redirect home.
        res.redirect('/');
      });

## Examples

For a complete, working example, refer to the [signin example](https://github.com/dglittle/passport-odesk/tree/master/examples/signin).



## Odesk Data Example
```

    {
        provider: 'odesk',
        id: 'John_Doe',
        name: { familyName: 'Doe', givenName: 'John' },
        ref: '3603850',
        displayName: '<NAME>',
        img: 'https://odesk-prod-portraits.s3.amazonaws.com/Users:johnDoe:PortraitUrl_50?AWSAccessKeyId=<KEY>&Expires=2147483647&Signature=P7XYYyZr9c%2Bvv%2F25voKeTg92eFc%3D',
        country: 'Russia',
        profile: 'https://www.odesk.com/users/~johnDoe',
        emails: [ { value: '<EMAIL>', type: 'work' } ],
        timezone: 'Europe/Klin',
        timezone_offset: '14400',
        location: { city: 'Klin', state: '', country: 'Russia' },
        company_url: 'http://example.com'
    }

```

## Tests

Not implemented, because package is not published at <[http://npmjs.org]>(http://npmjs.org)

## Credits

  - [<NAME>](https://github/vodolaz095)
  - [<NAME>](http://github.com/jaredhanson)

## License

[The MIT License](http://opensource.org/licenses/MIT)

Copyright (c) 2011-2013 <NAME> <[http://teksi.ru/resume/](http://teksi.ru/resume/)>
Based on Plugin <[https://github.com/jaredhanson/passport-twitter](https://github.com/jaredhanson/passport-twitter)>
by <NAME> <[http://jaredhanson.net/](http://jaredhanson.net/)>
<commit_msg>readne fixes<commit_after># Passport-Odesk

[Passport](http://passportjs.org/) strategy for authenticating with [Odesk](https://www.odesk.com/)
using the OAuth 1.0a API.

This module lets you authenticate using Odesk in your Node.js applications.
By plugging into Passport, Odesk authentication can be easily and
unobtrusively integrated into any application or framework that supports
[Connect](http://www.senchalabs.org/connect/)-style middleware, including
[Express](http://expressjs.com/).

## Install

    $ npm install passport-odesk

## Usage

#### Configure Strategy

We need to get this keyes from odesk api. I think the odesk team knows it better,
As for me, i was simply provided with this dada

    passport.use(new OdeskStrategy({
        consumerKey: '<KEY>',
        consumerSecret: '<KEY>',
        callbackURL: "http://127.0.0.1:3000/auth/odesk/callback"
      },
      function(token, tokenSecret, profile, done) {
        User.findOrCreate({ id: profile._id }, function (err, user) {
          return done(err, user);
        });
      }
    ));

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'odesk'` strategy, to
authenticate requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application:

    app.get('/auth/odesk',
      passport.authenticate('odesk'));
    
    app.get('/auth/odesk/callback',
      passport.authenticate('odesk', { failureRedirect: '/login' }),
      function(req, res) {
        // Successful authentication, redirect home.
        res.redirect('/');
      });

## Examples

For a complete, working example, refer to the [signin example](https://github.com/dglittle/passport-odesk/tree/master/examples/signin).



## Odesk Data Example
```

    {
        provider: 'odesk',
        id: 'John_Doe',
        name: { familyName: 'Doe', givenName: 'John' },
        ref: '3603850',
        displayName: '<NAME>',
        img: 'https://odesk-prod-portraits.s3.amazonaws.com/Users:johnDoe:PortraitUrl_50?AWSAccessKeyId=<KEY>&Expires=2147483647&Signature=P7XYYyZr9c%2Bvv%2F25voKeTg92eFc%3D',
        country: 'Russia',
        profile: 'https://www.odesk.com/users/~johnDoe',
        emails: [ { value: '<EMAIL>', type: 'work' } ],
        timezone: 'Europe/Klin',
        timezone_offset: '14400',
        location: { city: 'Klin', state: '', country: 'Russia' },
        company_url: 'http://example.com'
    }

```

## Tests

Not implemented, because package is not published at <[http://npmjs.org]>(http://npmjs.org)

## Credits

  - [<NAME>](https://github/vodolaz095)
  - [<NAME>](http://github.com/jaredhanson)

## License

[The MIT License](http://opensource.org/licenses/MIT)

Copyright (c) 2011-2013 <NAME> <[http://teksi.ru/resume/](http://teksi.ru/resume/)>

Based on Plugin <[https://github.com/jaredhanson/passport-twitter](https://github.com/jaredhanson/passport-twitter)>

by <NAME> <[http://jaredhanson.net/](http://jaredhanson.net/)>

{'fraction_non_alphanumeric': 0.15799288014917784, 'fraction_numerical': 0.01932530937447025, 'mean_word_length': 3.4161676646706587, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 14, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1610592', 'n_tokens_mistral': 2044, 'n_tokens_neox': 1920, 'n_words': 429}