Skip to content

Instantly share code, notes, and snippets.

View MrPrashantT's full-sized avatar

Prashant Trivedy MrPrashantT

View GitHub Profile
@MrPrashantT
MrPrashantT / rule.js
Created March 22, 2018 22:54
set OIDC conformant flag on context object
function (user, context, callback) {
var oidcConformantClients = ['client_id_1', 'client_id_2']; //oidc conformant clients
var isOidcConformantClient = oidcConformantClients.some(
function (clientId) {
return context.clientID === clientId;
});
if (isOidcConformantClient) {
context.isOidcConformant = true;
} else {
import { Component, OnInit } from '@angular/core';
import {FormGroup,FormControl,Validators} from '@angular/forms'
import { dashCaseToCamelCase } from '@angular/compiler/src/util';
@Component({
selector: 'app-fuel-calculation',
templateUrl: './fuel-calculation.component.html',
styleUrls: ['./fuel-calculation.component.css'],
})
export class FuelCalculationComponent implements OnInit {
An unhandled exception occurred while processing the request.
SecurityTokenInvalidSignatureException: IDX10503: Signature validation failed. Keys tried: 'Microsoft.IdentityModel.Tokens.X509SecurityKey , KeyId: MDEzREE0QjE2OUNGNkI2RTI0RDQwMjA1Q0ExMDRCQjZCRkVGRUMxNA
Microsoft.IdentityModel.Tokens.RsaSecurityKey , KeyId: MDEzREE0QjE2OUNGNkI2RTI0RDQwMjA1Q0ExMDRCQjZCRkVGRUMxNA
'.
Exceptions caught:
''.
token: '{"alg":"HS256","typ":"JWT"}.{"iss":"https://codexcreations.eu.auth0.com/","sub":"auth0|5926b10a01e91d140e99ee64","aud":"goOFNvxZ2tlti2Xi4pBitP50BtGunibl","exp":1495842476,"iat":1495806476,"nonce":"636314032700024893.ZjczNTFkM2MtMjRiNS00NmI5LTk0ZWItZjAyYjA0NDIxMTIwZjIyN2IwZWEtN2UyNC00YjIxLWEwY2ItNzgyNTBhNGM2ZWRl"}'.
System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateSignature(string token, TokenValidationParameters validationParameters)
AggregateException: Unhandled remote failure. (IDX10503: Signature validation failed. Keys tried: 'Microsoft.IdentityModel.Tokens.X509SecurityKey , KeyId
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
var async = require('async');
var request = require("request");
var _ = require("underscore");
module.exports = function(ctx, cb) {
const api_url = 'https://TENANT.auth0.com/api/v2/device-credentials';
var access_token;
var user_id = ctx.body.user_id;
@MrPrashantT
MrPrashantT / gist:779b9a7910eda48a4ca3eb20efb1c8c8
Created December 23, 2016 08:47
Store Facebook graph profile picture URL in User Metadata
function (user, context, callback) {
if(context.connection !== 'facebook'){
callback(null, user, context);
}
if(!user.user_metadata.fb_profile_pic){
user.user_metadata = user.user_metadata || {};
var fb_identity = _.where(user.identities,{provider: "facebook"});
{% case user.user_metadata.lang %}
{% when 'en' %}
ENGLISH
{% when 'de' %}
GERMAN
{% else %}
NO LANGUAGE
{% endcase %}