开发者

Is Piston ready for OAuth?

开发者 https://www.devze.com 2022-12-11 23:15 出处:网络
I tried using Piston for a simple API, hoping to use its OAuth support.But t开发者_JAVA百科he first time I hit the endpoint after enabling OAuth, I got an error:

I tried using Piston for a simple API, hoping to use its OAuth support. But t开发者_JAVA百科he 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?


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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消