Giter Site home page Giter Site logo

Comments (13)

bartve avatar bartve commented on July 4, 2024

Does it work with Discogs Auth as the authentication method?

from disconnect.

sampotts avatar sampotts commented on July 4, 2024

Apologies for my lack of knowledge but how would I do that?

from disconnect.

bartve avatar bartve commented on July 4, 2024

Like this: https://www.discogs.com/developers/#page:authentication,header:authentication-discogs-auth-flow

from disconnect.

sampotts avatar sampotts commented on July 4, 2024

So does the identity example no longer work then? I was just following the readme. Is it out of date?

from disconnect.

sampotts avatar sampotts commented on July 4, 2024

I think this was closed by mistake? It's still not working. Could you maybe try the examples? The identity example does not work.

from disconnect.

bartve avatar bartve commented on July 4, 2024

Oops, I didn't mean to close this indeed! Probably clicked the wrong button. Sorry! I will probably have time to look into this tomorrow.

from disconnect.

sampotts avatar sampotts commented on July 4, 2024

Cheers! I'm trying to help a mate out by building him an app and stuck at the moment :-(

On 13 Jun 2016, at 6:39 AM, Bart [email protected] wrote:

Oops, I didn't mean to close this indeed! Probably clicked the wrong button. Sorry! I will probably have time to look into this tomorrow.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from disconnect.

bartve avatar bartve commented on July 4, 2024

I did some tests and I don't seem to be able to reproduce the issue. Are you sure the access token is correctly persisted and passed? The OAuth flow is quite complicated and you must pass the final access token and not a token from an earlier step. Both Discogs Auth and OAuth authentication in combination with the identity endpoint seem to be working fine here. I also would have expected others to complain if this was broken.

from disconnect.

sampotts avatar sampotts commented on July 4, 2024

Thanks for taking a look. I'll send some more info when I get home.

On 14 Jun 2016, at 7:52 AM, Bart [email protected] wrote:

I did some tests and I don't seem to be able to reproduce the issue. Are you sure the access token is correctly persisted and passed? The OAuth flow is quite complicated and you must pass the final access token and not a token from an earlier step. Both Discogs Auth and OAuth authentication in combination with the identity endpoint seem to be working fine here. I also would have expected others to complain if this was broken.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from disconnect.

sampotts avatar sampotts commented on July 4, 2024

I'm using cookie-session to persist the accessData and requestData:

cookieSession = require('cookie-session');

app.use(cookieSession({
    keys: ['key1', 'key2']
}));

and then I store what's returned in accessData as below in the callback after oauth:

// Persist "accessData" here for following OAuth calls 
req.session.accessData = accessData;

console.log(accessData === req.session.accessData) straight after returns true as does console.log(dis.authenticated()). accessData returns the following (some parts hidden):

{ 
  method: 'oauth',
  level: 0,
  consumerKey: '...',
  consumerSecret: '...',
  token: '...',
  tokenSecret: '...',
  authorizeUrl: 'https://www.discogs.com/oauth/authorize?oauth_token=...' 
}

In the method that uses getIdentity a console.log(req.session.accessData) returns the same as above but it still doesn't seem to authenticate. I tried passing the token and tokenSecret properties rather than the whole object but it didn't seem to work either...

Which seems to be very similar to the requestData used in the earlier step? Sorry if it's a little confusing. I can send you the server.js file if it helps.

from disconnect.

sampotts avatar sampotts commented on July 4, 2024

OK, I figured it out. It was earlier in the process. Getting the access token was actually failing silently (as I wasn't checking the err argument value) due to the oauth_verifier query parameter being missing. It was because I wasn't accessing the query property when parsing the URL:

var query = url.parse(req.url, true).query;

Sorry about all this. Thanks for looking into it for me though 👍

from disconnect.

bartve avatar bartve commented on July 4, 2024

No problem. Glad you got it to work 👍

from disconnect.

codecreate avatar codecreate commented on July 4, 2024

Hi. I just found this exampe of a similar problem I'm having. I'm using the oAuth method and it's working fine up until trying the /identity test. The flow completes succesfully bringing me back to my app succesfully but I get a 401 auth error on /identity and when I investigate I discover that the accessData that I persisted in the /callback is the same as the requestData that I persisted in the /authorise. I'm persisting both those objects in app.locals. Any idea why they are the same? Neither the /authorise or /callback return any err.

Thanks

from disconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.