Is Piston ready for OAuth?
Asked Answered
E

2

3

I tried using Piston for a simple API, hoping to use its OAuth support. But the first time I hit the endpoint after enabling OAuth, I got an error:

TemplateDoesNotExist: oauth/challenge.html

and sure enough, there is no such file.

Does OAuth work in Piston? Am I making a stupid mistake?

Etter answered 13/11, 2009 at 22:23 Comment(2)
How's that coming along?Scanderbeg
@Ned - think you just accepted my answer - did you ever confirm it being a bug in Piston?Beata
B
2

Nope - that looks like a bug in Piston. oauth/challenge.html is referenced here, but does not exist anywhere in that project (see Piston's templates folder).

Could you try creating an empty oauth/challenge.html file somewhere in one of your directories specified in TEMPLATE_DIRS setting?

Beata answered 27/11, 2009 at 17:18 Comment(2)
It's not really a bug. For reusable apps, you're supposed to write your own templates.Swinger
@Swinger - for some things yeah, but surely not for issuing an oauth challenge?Beata
C
0

The challenge method in the authentication object is called when checking is_authenticated fails. I haven't tested this, but I am led to believe that challenge.html is most likely rendered when authorization has failed and an error needs to be displayed.

This is only a guess, but I think that it makes sense.

Cromer answered 7/12, 2009 at 19:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.