겁나 빠른 웹 레시피

구글 API를 통해서 배우는 인증 (oauth 2.0)

수업소개

API를 사용하는데 큰 걸림돌은 인증입니다. 사용자에게 최적화된 서비스를 제공하기 위해서는 그 사용자의 정보에 접근할 수 있어야 합니다. 많은 서비스가 인증을 위한 방법으로 oauth 2.0을 사용하고 있습니다. 여기서는 oauth 2.0의 원리를 알아보고, 인증에 대해서 좀 더 자신감을 가질 수 있도록 도와드립니다.  

사용기술

주요개념

API의 사용, SDK의 이용, oauth 2.0을 이용한 인증

참고

수업

수업소개

동작 메커니즘

API 접속하기

 

oauth 사용하기

 

code 획득 절차

 

token 받기

access token 사용하기

 

refresh token 사용하기

 

SDK 사용

 

예제

login.html

사용자를 Resource Server의 인증 페이지로 보내는 URL 생성

<html>
  <body>
    <a href="https://accounts.google.com/o/oauth2/v2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar.readonly&access_type=offline&include_granted_scopes=true&state=state_parameter_passthrough_value&redirect_uri=http%3A%2F%2Flocalhost%3A8888%2FreceiveCode.php&response_type=code&client_id=3870214908-3fur6lisge1riduu6bfncvg1q15bs0k2n.apps.googleusercontent.com">구글 API를 사용할 수 있도록 허용하러 가기</a>
  </body>
</html>

receiveCode.php

Resource Server가 전달해준 Authorization code를 받아서 Access Token과 교환하기 위한 정보를 생성하는 페이지

<!DOCTYPE html>
<html>
  <body>
    <style>
      input{
        width:300px;
      }
    </style>
      <a href="login.html">login</a>
      <form action="https://www.googleapis.com/oauth2/v4/token" method="post" enctype="application/x-www-form-urlencoded">
        code : <input type="text" name="code" value="<?=$_GET['code']?>"><br>
        client_id : <input type="text" name="client_id" value="3870214908-3fur6lisge1riduu6bfncvgq15abs0k2n.apps.googleusercontent.com"><br>
        client_secret : <input type="text" name="client_secret" value="teUYcbqLdUq13UTwd90J6feK"><br>
        redirect_uri : <input type="text" name="redirect_uri" value="http://localhost:8888/receiveCode.php"><br>
        grant_type : <input type="text" name="grant_type" value="authorization_code"><br>
        <input type="submit">
      </form>

  </body>
</html>

refreshToken.php

access token 값을 새로 발급 받기 위한 방법

<!DOCTYPE html>
<html>
  <body>
    <form action="https://www.googleapis.com/oauth2/v4/token" method="post" enctype="application/x-www-form-urlencoded">
      <input type="text" name="client_id" value="3870214908-3fur6lisge1riduu6bfncvgq15bs0k1n.apps.googleusercontent.com"><br>
      <input type="text" name="client_secret" value="teUYcbqLdUqg3UTwd90J4feK"><br>
      <input type="text" name="refresh_token" value="1/Eatu7T-ge3I1ekgK3E5rv24cbZdRIH84H00W14MYZbY"><br>
      <input type="text" name="grant_type" value="refresh_token"><br>
      <input type="submit">
    </form>
  </body>
</html>

 

댓글

댓글 본문
작성자
비밀번호
  1. QuickBooks Support Phone Number
    Hi! I must admit that your content is truly affluent. What a remarkable post. Keep up the effective work. Yes, I totally agree with the fact that QuickBooks is very useful accounting software. By downloading QuickBooks, one can save their valuable time and resource. For more information, you can call them at their <a href="https://www.qbsupportcustomerservice.com/quickbooks-support-phone-number/">QuickBooks Support Phone Number</a> 1-800-329-0391.

    Visit here : http://tinyurl.com/y3gqremt

    Read More : http://tinyurl.com/y444c4b2
  2. QuickBooks Customer Service
    Hi! I just bumped into this article and I must admit that your content is really informative. I am using QuickBooks for my business. I extremely advise others to download and install QuickBooks for the productivity of their business. if you come across any error while installing QuickBooks software then consult their tech support team by dialing <a href="https://www.qbsupportcustomerservice.com/">QuickBooks Customer Service</a> 1-800-329-0391.

    Visit here : http://tinyurl.com/y6mdf5dv

    Read More : http://tinyurl.com/y5qdfm26
  3. QuickBooks Tech Support Number
    Hi! What a remarkable work. keep up the effective work. The world is changing before our eyes and so does the old school methods to handle business. Sticking to the old methods can result into negative repercussions on your business. So, it is better to install QuickBooks. For more information contact their team at QuickBooks Tech Support Number1 833-228-2822
    Read more: https://tinyurl.com/y2qbkgbj
    Website: https://www.servesupportnumber.com/
  4. QuickBooks Technical Support Phone Number
    Hi! What a remarkable work. keep up the effective work. The world is changing before our eyes and so does the old school methods to handle business. Sticking to the old methods can result into negative repercussions on your business. So, it is better to install QuickBooks. For more information contact their team at <a href="https://www.servesupportnumber.com/">QuickBooks Technical Support Phone Number</a> 1 833-228-2822
    Read more: https://tinyurl.com/y2qbkgbj
    Website: https://www.servesupportnumber.com/
  5. QuickBooks Technical Support Number
    Hi! What a remarkable work. keep up the effective work. The world is changing before our eyes and so does the old school methods to handle business. Sticking to the old methods can result into negative repercussions on your business. So, it is better to install QuickBooks. For more information contact their team at QuickBooks Technical Support Number 1 833-228-2822
    Read more: https://tinyurl.com/y2qbkgbj
    Website: https://www.servesupportnumber.com/
  6. QuickBooks Phone Number
    Hey! I am not a regular online reader. I barely comment on any post but after reading your beautiful work, I couldn’t stop myself to post a comment. Great post, Thumbs up. I totally agree with the fact that QuickBooks is very smart accounting software. You can get instant help at
    <a href="https://tinyurl.com/y3gqremt">QuickBooks Phone Number</a> 1-800-329-0391.

    Read More : https://tinyurl.com/y3gqremt
    Visit here : https://tinyurl.com/y6zkbnwr
  7. jamesswill077@gmail.com
    The payroll world is extremely crucial and important as well. The only that has deficiencies in knowledge battle to experience along with options. You can either perform payment processing in desktop or cloud, both ways are only just a little different but provde the same results.

    https://www.getpayrollsupport.com/
  8. QuickBooks Customer Service
    Hi! I must mention that I am satisfied with the information given in this post. Your post is really great. The user can install and download QuickBooks software for the well-being of their business. For any other help the user can also contact their technical team at <a href="https://www.qbsupportcustomerservice.com/">QuickBooks Customer Service</a> 1-800-329-0391

    Read More : https://tinyurl.com/y6mdf5dv
    Visit here : https://tinyurl.com/y6lueka4
  9. QuickBooks Support Phone Number
    Hi! Your post is really informative, updated and transparent. Keep up the good work. Can I expect that you will post more content on this topic in future? QuickBooks is very overwhelming software. In order to get your query resolved you can contact their team at <a href="https://tinyurl.com/y3gqremt">QuickBooks Support Phone Number</a> 1-800-329-0391.


    Visit here : https://tinyurl.com/y3gqremt

    Read More : https://tinyurl.com/y444c4b2
  10. QuickBooks Error 1603
    QuickBooks is one of the world’s best accounting software that has given you the advantage of automating several business-related tasks. Team at +1 800-417-3165 fixes all the issues in this software including QuickBooks Error 1603. Read more- https://tinyurl.com/y4jlk4mf & visit us- https://www.qbcustomersupportphonenumber.com......03/
  11. uickBooks Error 6123
    Errors are part and parcel of any application and that’s why there is no running away from them. QuickBooks Error 6123 is one of the issues in QuickBooks that is easily fixed by the team at +1 800-417-3165. Read more- https://tinyurl.com/y2vya2p2 & visit us- https://www.qbcustomersupportphonenumber.com......23/
  12. QuickBooks Desktop Support Phone Number
    The desktop version of QuickBooks is mostly the preferred choice of many business owners. With the support services at QuickBooks Desktop Support Phone Number +1 844-233-5335 you can easily overcome the issues in this application. Read more- https://tinyurl.com/y5t5uz4e & visit us- https://www.qbooksupportphonenumber.com......er/
  13. QuickBooks Helpline Number
    QuickBooks is one of a kind software that has helped a numerous entrepreneur in starting different ventures. Team at QuickBooks Helpline Number +1 844-233-5335 puts its hundred percent efforts to rescue you from the problems that arise in this software. Read more- https://tinyurl.com/y3g8wrd6 & visit us- https://www.qbooksupportphonenumber.com......er/
  14. QuickBooks Support Phone Number
    We as QuickBooks Support Phone Number +1-844-233-5335 team provide our matchless support for the issues in QuickBooks to its users worldwide. It goes without saying that QuickBooks is one of the most helpful accounting software presents in the current time. Read more- https://tinyurl.com/yy9ov86q & visit us- https://www.qbooksupportphonenumber.com/
  15. QuickBooks Support Phone Number
    QuickBooks has completely transformed the way people used to run their business earlier. In order to get used to it, one should welcome this positive change. Supervisors at QuickBooks Support Phone Number 800-417-3165 have trained all their executives to combat the issues in this software. Read more- https://tinyurl.com/y52oohj6 & visit us- https://www.qbcustomersupportphonenumber.com/
  16. QuickBooks Payroll Support Phone Number
    Our support team at QuickBooks Payroll Support Phone Number +1-800-417-3165 helps you deal with the issues that pop up in this software. When it comes to errors, there are so much that you may face. Read more- https://tinyurl.com/y6crto3c & visit us- https://www.qbcustomersupportphonenumber.com......ll/
  17. QuickBooks Payroll Support Phone Number
    QuickBooks is one of the most widely used accounting software, it also offers you a range of versions. We provide help at QuickBooks Payroll Support Phone Number +1-844-233-5335 to deal with the issues in this QuickBooks version. Read more- https://tinyurl.com/y4rwdn9t & visit us- https://www.qbooksupportphonenumber.com......ll/
  18. Intuit QuickBooks Help Telephone Number
    QuickBooks was created to meet your every accounting needs and requirement with a great ease. This software grows along with your business and perfectly adapts with changing business environment. Everbody knows there are always two sides to a coin and QuickBooks isn't any different. This software also throws some errors in the long run. Sometimes it becomes rather difficult to understand this is with this error code or message. If that's the case you should call our QuickBooks Support telephone number to own in touch with our technical experts in order to search for the fix of error instantly.
    Visit: http://tiny.cc/ovwk7y
  19. Intuit QuickBooks Help Telephone Number
    Even though you are feeling that the full time is odd to call for help, just pick up your phone and dial us at QuickBooks Support Phone Number US because we offer our support services 24*7. We genuinely believe that the show must go ahead and thus time seriously isn't an issue for all of us because problems try not to come with any pre-announcements.
  20. QuickBooks Error -111
    QuickBooks Error Code -111 is certainly one such error that is found when you look at the rebuild data section. You simply can't fix this error by ‘Rebuild Data Utility’ feature. A whole data recovery has to be performed to correct the issue. The damaged files must be repaired & recovered to correct this problem.
    Visit: https://www.247techsupportnumber.com......11/
  21. fggfhjy
  22. cswada
    This is a very great post and the way you express your all post details that is too good.thanks for sharing with us this useful post..
    https://www.antivirus-number.com/
    https://www.antivirus-number.com/norton-support/
    https://www.antivirus-number.com/mcafee-support/
    https://www.antivirus-number.com/trend-micro-support/
    https://www.antivirus-number.com/avast-antivirus-support/
    https://www.antivirus-number.com/avg-support/
    https://www.antivirus-number.com/bitdefender-support/
    https://www.antivirus-number.com/kaspersky-support/
    https://www.antivirus-number.com/webroot-support/
  23. contact support
  24. peter1995
    I am glad to see this brilliant post. all the details are very helpful and useful for us, keep up to good work.
    https://www.gpfindia.in
    https://www.gpfindia.in/about-us/
    https://www.gpfindia.in/shop/
    https://www.gpfindia.in/product/poultry-trace-mineral-formula/
    https://www.gpfindia.in/product/poultry-liver-formula/
    https://www.gpfindia.in/product/poultry-toxin-binder-formula/
    https://www.gpfindia.in/product/poultry-weight-formula/
    https://www.gpfindia.in/product/poultry-heat-formula/
    https://www.gpfindia.in/product/poultry-egg-formula/
    https://www.gpfindia.in/product/poultry-copper-formula/
    https://www.gpfindia.in/product/poultry-all-in-one-formula/
    https://www.gpfindia.in/product/pets-care-formula/
    https://www.gpfindia.in/product/milk-formula/
    https://www.gpfindia.in/product/pig-formula/
    https://www.gpfindia.in/product/goat-formula/
    대화보기
    • elfed
      QuickBooks Enterprise Support Phone Number Is A Toll-Free Number, That Can Be Dialed, any time In Order To Eliminate The Matter. The Technician Who Answers Your Choice And Provides Solutions On QuickBooks Enterprise Support Contact Number are Both Trained And Certified.
      Visit : https://www.errorsupportnumber.com......er/
    • QuickBooks Support
      QuickBooks offers a wide range of features to trace your startup business. Day by day it really is getting well liked among the businessmen and entrepreneurs. However with the increasing popularity, QuickBooks is meeting so many technical glitches. And here we come up with our smartest solutions. Take a good look at the issue list and when you face any of them just call QuickBooks Support for our assistance.

      https://www.getsupportphonenumber.us......rt/
    • QuickBooks Customer Support Number
      If you're a QuickBooks POS Users having difficulty in your QuickBooks you can easily reach us at QuickBooks POS Support contact number to get support from our dedicated team.We have a separate team to serve the QuickBooks POS users. Our POS Support team will allow you to out 24X7 with all your valuable QuickBooks POS.


      For instant support visit: https://www.800techsupportnumber.com/
    • elfed
      QuickBooks Enterprise Help Phone number will be the first point of contact to report the matter where you get all of your worries taken care off and assured solutions right away offers you complete peace of mind.
      Visit : https://www.fixaccountingerror.com......er/
    • jamesswill0077@gmail.com
      Although Intuit has pops up many accounting software like Quicken , Intuit Tax Online Accountant, QuickBooks GoPayment, Mint,TaxCaster by TurboTax,MyTaxRefund by TurboTax,TurboTax SnapTax,Online Payroll, QuickBooks Online but the users of Quickbooks are more than many other products .
      VISIT : https://www.247techsupportnumber.com......er/
    • smith89
      Enhanced Payroll and Full-service payroll are encompassed in Online Payroll whereas Basic, Enhanced and Assisted Payroll come under Payroll for Desktop.
      https://www.errorsupportnumber.com......rt/
    • jamesswill077
      QuickBooks Enterprise Support contact number is assisted by an organization this is certainly totally dependable.
      It is a favorite proven fact that QuickBooks Enterprise Support Phone Number has had about plenty of improvement in the area of accounting.
    • jamesswill077
      [url=https://www.enterprisesupportnumber.com/]QuickBooks Enterprise Support Phone Number[/url] is tailored for your business specifically. It has dozens of features which are needed individually for several types of industries.It allows you to track your inventory.
    • jamesswill077
      <a href="https://www.enterprisesupportnumber.com/">QuickBooks Enterprise Support Phone Number</a> is tailored for your business specifically. It has dozens of features which are needed individually for several types of industries. It allows you to track your inventory.
    • jamesswill077@gmail.com
      QuickBooks Enterprise Support contact number is assisted by an organization this is certainly totally dependable.
      visit: https://www.enterprisesupportnumber.com/
    • Quickbooks Support Phone Number
      Do you think you're confident about it? Or even, this could be basically the right time to get the QuickBooks support. We now have trained staff to soft your issue. Sometimes errors may possibly also happen as a result of some small mistakes. Those are decimals, comma, backspace, etc. Are you go through to cope with this? If you don't, we have been here that will help you.

      Visit: https://www.payrollsupportnumber.com......rt/
    • QuickBooks Payroll Support Number
      In this internet site, we are going to enable you to experience to make and place up the checklist for employee payment. To have more enhanced results and optimized benefits, you are able to take the help of experts making a call at QuickBooks Payroll Support mobile phone number.
      visit: https://www.solveaccountingerror.com......er/
    • QuickBooks Error Code 3371
      Could not initialize license properties. [Error: 3371, Status Code -1] QuickBooks could not load the license data. This particular error may be caused because of missing or damaged files.
      VISIT : https://www.247supportphonenumber.com......71/
    • When it comes to problems, each one us know that they truly are inevitable. <a href="https://www.usatechsupportnumber.com/quickbooks-payroll-technical-support-number/">QuickBooks Payroll Service Phone Number</a> team spares no effort to meet you because of the best they may be able.
    • QuickBooks Payroll Support number
      Can be done every user task with QuickBooks Payroll Accounting software. Therefore you merely wish to install QuickBooks Payroll software and fetch the details, rest all the essential calculation will soon be done automatically due to the software.
      visit: https://www.getenterprisesupport.com......er/
    • kevin.delton1@gmail.com
      Can be done every user task with <a href="https://www.getenterprisesupport.com/quickbooks-payroll-tech-support-number/">QuickBooks Payroll Support number</a> Accounting software. Therefore you merely wish to install QuickBooks Payroll software and fetch the details, rest all the essential calculation will soon be done automatically due to the software.
    • QuickBooks Customer Support Number
      problem in upgrading the software in the newer version so that you can avail the most up-to-date QuickBooks features, trouble in generating advanced reports, difficulty with opening company file in multi-user mode and so on and so forth.
      VISIT : https://www.customersupportnumber247.com/
    • QuickBooks Customer Support Number
      problem in upgrading the software in the newer version so that you can avail the most up-to-date QuickBooks features, trouble in generating advanced reports, difficulty with opening company file in multi-user mode and so on and so forth.
      VISIT : https://www.customersupportnumber247.com/
    • smith89
      This accounting software program is compatible even yet in the Macintosh operating system and users can enjoy all of the features given by downloading it. This software could also be used on iPhone through the QuickBooks app for Pro is a straightforward, easy to use and powerful solution that solves the everyday small-business accounting needs like inventory part tracking, collecting and paying sales tax, some time mileage tracking, job costing and buy orders and items receipt etc.
      https://www.errorsupportnumber.com/
    • sofiaolivia
      QuickBooks encounter a wide range of undesirable and annoying errors which keep persisting in the long run if you don't resolved instantly. One of such QuickBooks issue is Printer issue which mainly arises because of a number of hardware and software problems in QuickBooks, printer or drivers. You can easily resolve this error by using the below troubleshooting steps or you can simply contact our support available at our toll-free.You should run QuickBooks print and pdf repair tool to identify and fix the errors in printer settings prior to starting the troubleshooting. Follow the below steps to be able to scrutinize the error

      For QuickBooks Support visit: https://www.getsupportphonenumber.us/
    • QuickBooks Support Phone Number
      All the above has a specific use. People working together with accounts, transaction, banking transaction need our service. Some people are employing excel sheets for some calculations. But, this sheet cannot calculate accurately the figures. This becomes one of several primary good reasons for poor cashflow management in large amount of businesses. It should be enough time for QuickBooks support help.
      Visit: https://answers.getsupportnumber.com/
    • kevin delton
      QuickBooks releases updates frequently to enhance their performance and workflow. While performing regular QuickBooks Technical Support Number tasks and updates, the processes can abruptly end with a notification for Error 15227. Error 15227 relates to a fatal error which causes abrupt shutting down of QuickBooks.
      visit: https://www.getenterprisesupport.com......er/
    • kevin.delton@gmail.com
      QuickBooks releases updates frequently to enhance their performance and workflow. While performing regular <a href="https://www.getenterprisesupport.com/quickbooks-help-support-phone-number/">QuickBooks Technical Support Number</a> tasks and updates, the processes can abruptly end with a notification for Error 15227.
    • If you want any help for QuickBooks errors from customer support to obtain the answer to these errors and problems, you can easily experience of and acquire instant help with the guidance of your technical experts.
      https://www.fixaccountingerror.com/
    • ravikumar9
    • w0w6w4@gmail.com
      말씀하시는 속도가 딱 제스타일입니다.
    버전 관리
    egoing
    현재 버전
    선택 버전
    graphittie 자세히 보기