Skip to content

Instantly share code, notes, and snippets.

View code-atom's full-sized avatar
🏠
Working from home

Ankit Rana code-atom

🏠
Working from home
View GitHub Profile
@code-atom
code-atom / setAuthProfile.soapui
Last active August 7, 2019 08:44
Set Auth Profile API
import com.eviware.soapui.config.CredentialsConfig;
for(testSuiteItem in testSuite.project.getTestSuiteList()) {
for( testCaseItem in testSuiteItem.getTestCaseList()) {
for( testStep in testCaseItem.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep) ) {
log.info("Setting basic auth for all REST test requests in testStep ["+testStep.getName()+"]")
testStep.getTestRequest().setEndpoint('https://localhost');
testStep.getTestRequest().setSelectedAuthProfileAndAuthType("TEST_DM_TOKEN", com.eviware.soapui.config.CredentialsConfig.AuthType.O_AUTH_2_0);
}
}
}
@code-atom
code-atom / JwtValidator.cs
Created May 18, 2020 18:16
Jwt Token Validator with all default properties.
using Microsoft.IdentityModel.Protocols;
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
using Microsoft.IdentityModel.Tokens;
using System;
using System.IdentityModel.Tokens.Jwt;
using System.Threading;
namespace JwtValidator
{
class Program
@code-atom
code-atom / odic-pre-request-postman.js
Created September 9, 2020 10:48
OIDC Authorization Proof Key in Postman Per-Request
var crypto = require("crypto-js");
var interval = setTimeout(function() {}, 10000);
var b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var b64pad = "=";
var stsEndpoint = 'https://XX-XXX-XXX-XXX.XXX.net/ids';
var tokenEndpoint = stsEndpoint + '/connect/token';
var authorizationEndpoint = stsEndpoint + '/connect/authorize';
var loginEndpoint = stsEndpoint + '/login';
@code-atom
code-atom / long-press.directive.ts
Last active November 24, 2021 11:08
Long press directive in Angular
import {
Directive,
ElementRef,
EventEmitter,
OnDestroy,
Output
} from "@angular/core";
import {
fromEvent,
merge,