Skip to content

Instantly share code, notes, and snippets.

View gatherKnowledge's full-sized avatar
😅

Luke.moon gatherKnowledge

😅
  • MyPlanet Inc.
  • San Francisco, State of California.
View GitHub Profile

소개

이 글은 Oauth를 이용해서 access token을 획득한 후에 api에 접속하는 방법에 대해서 설명하고 있습니다.

우선 공부해야 할 것들

이 글은 WEB2 OAuth2 수업과 WEB2 HTTP 수업에 의존하고 있습니다. OAuth와 HTTP를 잘 모르신다면 이 수업들을 먼저 보시고 이 글을 볼 것을 권해드립니다.

Bearer Authentication란?

API에 접속하기 위해서는 access token을 API 서버에 제출해서 인증을 해야 합니다. 이 때 사용하는 인증 방법이 Bearer Authentication 입니다. 이 방법은 OAuth를 위해서 고안된 방법이고, RFC 6750에 표준명세서가 있습니다.

@gatherKnowledge
gatherKnowledge / Model.js
Created May 20, 2020 05:08
My Axios module
import axios from "axios";
import qs from 'qs';
export default class Model {
constructor(modelName) {
this.modelName = modelName;
const instance = axios.create({
baseURL: 'http://127.0.0.1/api/',
timeout: 1000,
headers: {'X-Custom-Header': 'foobar'},
@gatherKnowledge
gatherKnowledge / signature.ts
Last active November 12, 2020 17:28
signature
type funcType = (a: string) => (b: string) => void;
const realizeFunc: funcType = (a: string) => {
return (b: string) => {
console.log(b);
}
}
realizeFunc('')('hello world!');
class House {
address?: string;
postCode?: string;
constructor() { }
}
class HouseBuilder {
private readonly _house: House;
type MyType = {
a1: number;
a2: number;
a3: string;
}
const foo1 = {
a1: 1
};
const readline = require("readline");
const chalk = require("chalk");
const axios = require("axios");
const PROTOCOL = "http";
const URI = "localhost";
const PORT = 3000;
const SERVER = `${PROTOCOL}://${URI}:${PORT}`;
const PREFIX_PATH = "produce";
const TOKEN = "xxxxxxxxxxx";
@gatherKnowledge
gatherKnowledge / public-stun-list.txt
Created September 12, 2021 13:20 — forked from mondain/public-stun-list.txt
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478