Giter Club home page Giter Club logo

oauth-demo-for-oracle-example-hr's Introduction

概要

apex.oracle.comのOAuth2.0で保護されたoracle.example.hr APIにアクセスするデモアプリ

利用方法

まずこちらのQiitaの記事にある通り、apex.oracle.com側でAPIの権限設定、およびクライアントの登録をおこないます。 http://qiita.com/nkjm/items/38da1b6816f6f6ac8aca

デモアプリをクローンし、npmパッケージをインストールします。

$ git clone https://github.com/nkjm/oauth-demo-for-oracle-example-hr.git
$ cd oauth-demo-for-oracle-example-hr/
$ npm install

config.jsファイルを編集し、WORKSPACE, CLIENT_ID, CLIENT_SECRETをご自身の環境の値に置き換えます。

$ vi config.js
'use strict';

exports.CLIENT_ID = 'あなたのCLIENT_ID';
exports.CLIENT_SECRET = 'あなたのCLIENT_SECRET';
exports.WORKSPACE = 'あなたのAPEXワークスペース';

Nodeアプリを起動します。

$ node index.js
Server is running on port 5000

ブラウザを起動し、 http://localhost:5000 にアクセスします。 するとOAuth2.0の認証フローが開始されます。

認証が成功すると、Nodeアプリにリダクレクトされ、画面にはアクセストークンの情報が表示されます。 この状態で続けて http://localhost:5000/employees にアクセスすると、保護されたAPIにアクセストークンを付与してアクセスがおこなわれ、employeeの一覧がJSON形式で返され画面に表示されます。

oauth-demo-for-oracle-example-hr's People

Contributors

nkjm avatar

Watchers

 avatar  avatar  avatar

Forkers

co360

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.