android - oauth 2 implementation in mobile SDK -


i have created sdk , want integrate oauth authentication process. want same facebook sdk do, if client app installed , login, switch app ask permission , switch app wants authorise it. if client app not there open webpage , on login ask permission , redirect app after login.

we have implemented oauth on server not sure grant_type use achieve above functionality. can not store password in client app.

let me know if has idea how achieve functionality , implementing same flow other sdks(facebook, twitter) does.

for mobile based apps use following url authentication:

post https://api.example.com/token grant_type=authorization_code& code=auth_code_here& redirect_uri=redirect_uri& client_id=client_id 

pass authentication code app if user login else if user not login first navigate login page, on successful login authorization page come as-usual. note: might unsecure sending code in query param, doing in request on ssl enhanced security.

for browser authentication

https://example.com/auth?response_type=token& client_id=client_id&redirect_uri=redirect_uri&scope=photos 

where authentication picks login session if user login.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -