php - What should be the right API structure using CakePHP -


i've been working while on api-including project. have apiuserscontroller handles user's actions api , api controller. need ensure secure, i've created apikey() function detects if user sending request api has right credentials.

my question should put apikey() function in order make use of in api controller?

any api security recommendations welcomed.

thank in advance!

my question should put apikey() function in order make use of in api controller?

easy answer, correct place authentication adapter. ceeram has created token (that's you're using) adapter cakephp. see link here.

if want more secure way should go oauth suggested dave. instead of using specific oauth plugin go opauth cakephp, comes oauth strategy adapter.

also instead of creating api controllers use prefix routing , share of code api actions normal actions in model. way can reused easy , no need duplicate work.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -