SHA256にした
This commit is contained in:
		
							parent
							
								
									13ef9f6e6f
								
							
						
					
					
						commit
						2b1cbcc8bf
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		|  | @ -71,6 +71,6 @@ block content | ||||||
| 				br | 				br | ||||||
| 				| 上手くいけば、認証したユーザーのアクセストークンがレスポンスとして取得できます。おめでとうございます! | 				| 上手くいけば、認証したユーザーのアクセストークンがレスポンスとして取得できます。おめでとうございます! | ||||||
| 			p | 			p | ||||||
| 				| 以降アクセストークンは、<strong>ユーザーのアクセストークン+アプリのシークレットキーをsha512したもの</strong>として扱います。 | 				| 以降アクセストークンは、<strong>ユーザーのアクセストークン+アプリのシークレットキーをsha256したもの</strong>として扱います。 | ||||||
| 
 | 
 | ||||||
| 	p アクセストークンを取得できたら、あとは簡単です。REST APIなら、リクエストにアクセストークンを<code>i</code>としてパラメータに含めるだけです。 | 	p アクセストークンを取得できたら、あとは簡単です。REST APIなら、リクエストにアクセストークンを<code>i</code>としてパラメータに含めるだけです。 | ||||||
|  |  | ||||||
|  | @ -72,9 +72,9 @@ module.exports = (params, user) => | ||||||
| 		}); | 		}); | ||||||
| 
 | 
 | ||||||
| 		// Generate Hash
 | 		// Generate Hash
 | ||||||
| 		const sha512 = crypto.createHash('sha512'); | 		const sha256 = crypto.createHash('sha256'); | ||||||
| 		sha512.update(token + app.secret); | 		sha256.update(token + app.secret); | ||||||
| 		const hash = sha512.digest('hex'); | 		const hash = sha256.digest('hex'); | ||||||
| 
 | 
 | ||||||
| 		// Insert access token doc
 | 		// Insert access token doc
 | ||||||
| 		await AccessToken.insert({ | 		await AccessToken.insert({ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue