Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Login with Twitter (Kirby)

  • This topic is empty.
Viewing 15 posts - 31 through 45 (of 55 total)
  • Author
    Posts
  • #120862
    __
    Participant

    > If I went to /example, I’d get a PHP error. I went to /example/twitter, I’d get the same error you received and if I refreshed that same page, the error would show what the problem was.

    `Warning: array_key_exists() …`
    `Invalid auth response: Missing key auth response components.` ?

    That’s actually a PHP error, because when you refreshed the page there was no longer an auth response. The example files have no error checking whatsoever.

    If you got something else, what did it say?

    #120863
    chrisburton
    Participant

    @traq

    > Warning: array_key_exists() …
    Invalid auth response: Missing key auth response components. ?

    That’s the one. I didn’t receive any other error besides that.

    #120887
    chrisburton
    Participant

    From briefly talking to the author of Opauth, this is on Twitter’s end apparently.

    Additionally, I read on the discussion area of the API docs that it could be caused by the time of my server not being synced to Twitter’s server time. However, I don’t see this to be the cause after testing locally and on a live server.

    #120894
    __
    Participant

    > From briefly talking to the author of Opauth, this is on Twitter’s end apparently.

    Did he have any insights as to what twitter’s problem is? AFAICT, Opauth seems to follow twitter’s API requirements.

    #120902
    chrisburton
    Participant

    @traq No. He just told me to contact Twitter. I just replied to that and basically said, “if it was on Twitter’s end, why would it work on an alternate library?”.

    #120904
    __
    Participant

    ’cause the alt lib knows what twitter’s on about. : )

    is Shiflett’s code what you tried that works?

    #120905
    chrisburton
    Participant

    @traq Ha. Yes, it is. I got the library from here.

    Now I just have to figure out how to use the API to post comments. Not sure if I should integrate it with Kirby’s auth plugin or if that isn’t necessary.

    #120906
    __
    Participant

    Is this session-only (twitter provides all info you need, users comment thru twitter), or are you integrating more tightly with your site (twitter authenticates, but you’re storing the comments yourself (and possibly other user data also))? Do you need to assign permissions to users that you won’t be able to determine indirectly, based on the info twitter provides?

    Basically, are you flat-out *using twitter accounts on your site*, or are you only *using twitter as a sign-in mechanism*?

    #120908
    chrisburton
    Participant

    @traq Let me turn this around, what would you suggest?

    I just want the user to be able to use their Twitter credentials (username and profile photo) for posting comments. Example.

    In the form, I would also prefer that I have an edit option for the user to correct any mistakes. This stops them from commenting multiple times to clear up an error.

    #120914
    __
    Participant

    Personally, I’d want to keep the comments myself – that doesn’t mean it’s a “better” solution, it’s just what I’d want. I’d maintain my own user/auth system; I’d just have twitter take care of the “sign-in” part. I wouldn’t necessarily be using much from the twitter API beyond that, though it would obviously be available.

    #120916
    chrisburton
    Participant

    @traq I think it may be smarter to do that in case I switch to something else. I will already have the comments in a database. Any ideas on how to go about this?

    I’d obviously just have a login link that just authenticates (not authorizes) the user. I believe all I need is a single textarea field and some way to allow the user to edit their post. The form will be hidden by default until the user is authenticated. Or would I need some way of verifying the user?

    #121005
    chrisburton
    Participant

    Update: The author of Opauth is testing my code

    #121006
    __
    Participant

    @chrisburton

    Are you asking about the login or the comment form or the database?

    Or all three

    (1) Don’t include the comment form at all if not logged in.

    (2) Every time you provide a form that’s tied to a specific user/action, it should have a token attached to it so you can validate that you gave the form to the particular user (recently).

    (3) I’d think the DB would need to store…

    … user.id of the comment author

    … date+time comment was authored

    … display status (show,hide,starred,buried,etc.)

    … comment thread id

    … the comment itself

    You’d need an extra field if you allowed users to comment on comments – the above would work for a simple list (ordered chronologically), but you’d need more if you wanted a tree structure.

    If you wanted to “version” comments (keep a record of edits), you’d need a field to track versions as well.

    #121007
    chrisburton
    Participant

    I solved the Opauth issue myself. I only had to add my consumer key and secret into the config file and not into any other files like I was doing.

    #121012
    chrisburton
    Participant

    @traq Hmm. Sounds complicated.

    > … user.id of the comment author

    This is to verify and target the user, correct?

    > … date+time comment was authored

    This could be used for displaying comments in a timely order.

    > … display status (show,hide,starred,buried,etc.)

    Not quite sure what I would do with this. Perhaps be able to delete comments?

    > … comment thread id

    This sounds like it’s for displaying the information on the correct blog post.

    > You’d need an extra field if you allowed users to comment on comments – the above would work for a simple list (ordered chronologically), but you’d need more if you wanted a tree structure.

    I will not be allowing this. If the user wants to reply to another user, @username that user.

    > If you wanted to “version” comments (keep a record of edits), you’d need a field to track versions as well.

    Not sure I’m understanding why I would need a separate field just for edits?

Viewing 15 posts - 31 through 45 (of 55 total)
  • The forum ‘Back End’ is closed to new topics and replies.