You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

oracle-apex-oauth

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oracle-apex-oauth

OAuth library for apex.oracle.com.

1.0.0
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

概要

apex.oracle.comのRESTful ServicesでOAuth2.0で保護されたAPIにNodeアプリからアクセスするためのnpm packageです。

インストール

$ npm install oracle-apex-oauth

利用方法

認証

const oauth = require('oracle-apex-oauth');

app.use('/oauth', oauth({
    client_id: 'あたたのClient Id',
    client_secret: 'あなたのClient Secret',
    flow: 'code', // codeまたはimplicit
    workspace: 'あなたのAPEX WORKSPACE',
    redirect_url: '/' // トークン取得後にリダクレクトされるURL
}));

認証が成功すると、アクセストークンはセッションから取得できます。

const session = require('express-session');

app.use(session({
    secret: 'あなたのClient Id',
    resave: false,
    saveUninitialized: false
}));

app.get('/', function(req, res, next){
    if (req.session.oauth){
        res.json(req.session.oauth);
    } else {
        res.send('No Token.');
    }
});

Keywords

OAuth

FAQs

Package last updated on 27 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts