Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
| using System; | |
| using System.Security.Cryptography; | |
| public class PBKDF2 | |
| { | |
| private int hashBytes; | |
| private int saltBytes; | |
| private int iterations; | |
| public PBKDF2(int _hashBytes, int _saltBytes, int _iterations) |
| { | |
| "scripts": { | |
| "ram": "yarn ram-check-disk && yarn ram-create-disk && yarn ram-link-node-modules && yarn ram-link-build && yarn install && yarn start", | |
| "ram-check-disk": "[ -d /Volumes/npm_ram_disk ] && echo 'Disk already mounted!' && yarn build && exit 1 || exit 0", | |
| "ram-create-disk": "diskutil erasevolume hfsx npm_ram_disk `hdiutil attach -nomount ram://1600000`", | |
| "ram-link-node-modules": "mkdir /Volumes/npm_ram_disk/node_modules && rm -r -f ./node_modules && ln -s /Volumes/npm_ram_disk/node_modules ./node_modules", | |
| "ram-link-build": "mkdir /Volumes/npm_ram_disk/build && rm -r -f ./build && ln -s /Volumes/npm_ram_disk/build ./build", | |
| } | |
| } |
| package main | |
| import ( | |
| "crypto/tls" | |
| "crypto/x509" | |
| "flag" | |
| "io" | |
| "io/ioutil" | |
| "log" | |
| "os" |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "net" | |
| "net/http" | |
| "net/url" | |
| "crypto/tls" |
Enable #enable-devtools-experiments flag in chrome://flags section.
Open Chorme Devtools and check Settings > Experiments > Allow extensions to load custom stylesheets.
Create the following four files in a dedicated folder.
3.1. devtools.html
<html>
<head></head>
<body><script src="devtools.js"></script></body>| package main | |
| import ( | |
| "bytes" | |
| "crypto/aes" | |
| "crypto/cipher" | |
| b64 "encoding/base64" | |
| "errors" | |
| "fmt" | |
| "log" |
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using StackExchange.Redis; | |
| namespace CitySurvival.Redis | |
| { |
| using System.Net.Http; | |
| using (var client = new HttpClient()) | |
| { | |
| var url = "http://google.com/api-example"; | |
| var response = client.GetAsync(url).Result; | |
| if (response.IsSuccessStatusCode) | |
| { | |
| // by calling .Result you are performing a synchronous call |