Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What technical detail should programmers consider while developing their own oAuth service?

What technical detail should programmers consider while developing their own oAuth service?

Have been trying to find out guidelines, but found most of the oAuth related articles discuss as a consumer point of view (i.e. how to consume others service). I want to design my own oAuth system with my authorization service and resource service. What technical detail should I follow?

like image 639
Sazzad Hissain Khan Avatar asked Feb 23 '20 15:02

Sazzad Hissain Khan


People also ask

What is the most common type of application you encounter when dealing with OAuth servers?

Server-side apps are the most common type of application encountered when dealing with OAuth servers. These apps run on a web server where the source code of the application is not available to the public, so they can maintain the confidentiality of their client secret.

What is OAuth in programming?

OAuth (Open Authorization) is an open standard authorization framework for token-based authorization on the internet.

What are the four roles defined by OAuth?

OAuth defines four roles: Resource owner (the user) Resource server (the API) Authorization server (can be the same server as the API) Client (the application)

What makes OAuth so effective as an authentication framework?

OAuth doesn't share password data but instead uses authorization tokens to prove an identity between consumers and service providers. OAuth is an authentication protocol that allows you to approve one application interacting with another on your behalf without giving away your password.


2 Answers

You probably have read the RFCs but just in case you haven't, they're the place you want to start:

  1. oAuth 2.0 "core" (RFCs 6749 and 6750)
  2. Proof Key for Code Exchange (PKCE) (RFC 7636)

The best 'packaged' guidance for oAuth implementers (client or otherwise) is available via IETF Best Current Practices (BCPs). Most people know about IETF RFCs and (confusingly) BCPs are published as RFCs with a RFC number. Despite that, they're best practices and not formal specifications:

The BCP process is similar to that for proposed standards. The BCP is submitted to the IESG for review, and the existing review process applies, including a "last call" on the IETF announcement mailing list. However, once the IESG has approved the document, the process ends and the document is published. The resulting document is viewed as having the technical approval of the IETF, but it is not, and cannot become an official Internet Standard.

BCPs you want to review:

  1. oAuth security (up to date as of this writing)
  2. oAuth for browser-based apps (up to date as of this writing).
  3. oAuth for native apps (published in 2017 as an update to "core" oAuth 2.0 RFC, still a good read)
  4. JSON Web Tokens for oAuth (up to date)

These documents are framed in threat model terms - they cover attacks (or "security considerations" as a diluted format) and countermeasures. You might be looking for a more straightforward building blocks type of a roadmap and perhaps there should be one as an educational tool. Real-world oAuth implementations must be developed with a prima facie evidence of a threat model.

As one samurai said: ...swordsmanship untested in battle is like the art of swimming mastered on land.

like image 139
identigral Avatar answered Sep 29 '22 13:09

identigral


I would also be interested to hear why you want to develop your own auth solution.

But putting that aside, there is an open source project that does exactly what you ask - Identity Server. You can check out their source code or fork it and build something on top of it.

Also, please check "identigral" answer on various docs.

like image 41
eddyP23 Avatar answered Sep 29 '22 11:09

eddyP23