Skip to content

Instantly share code, notes, and snippets.

@dkeer
dkeer / token-interceptor.service.ts
Created July 19, 2021 21:49 — forked from abereghici/token-interceptor.service.ts
Angular Tutorial — Implement Refresh Token with HttpInterceptor
// src/app/services/token-interceptor.service.ts
import { Injectable } from "@angular/core";
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from "@angular/common/http";
import { AuthenticationService } from "../authentication.service";
import { Observable } from "rxjs/Observable";
import { BehaviorSubject } from "rxjs/BehaviorSubject";
@Injectable()
export class RefreshTokenInterceptor implements HttpInterceptor {
@dkeer
dkeer / cert-curl.php
Created June 15, 2021 21:43 — forked from nebulak/cert-curl.php
PHP curl request with ssl/tls client certificate
<?php
//source: http://www.zedwood.com/article/php-curl-connect-with-ssl-client-certificate
class SecureRequest
{
private m_publicCertPath; //"/public_cert.pem"
private m_privateCertPath; //"/private.pem")
private m_caInfoPAth; //"/etc/ssl/certs/ca-certificates.crt"
public function init($publicCertPath, $privateCertPath, $caInfoPath) {
$this->m_publicCertPath = $publicCertPAth;