Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Wednesday, August 05, 2020

How to quickly create cryptographic secrets using nodejs

This was stolen adapted from JWT Authentication Tutorial - Node.js by @DevSimplified.

First, start up node from a terminal. Then type the following:

This will simply 

First, start up node from a terminal. Then execute the following line:
The result will be a secret token.

Here's the same thing as an executable JavaScript file, which outputs the token as both hex and base64:

Sunday, April 26, 2009

Using Script# with ASP.NET

Random notes on this topic.
  • Follow instructions here on wiring up the control, specifically the parts about implementing IScriptControl, and overriding OnPreRender() and Render(). However you *must* make one crucial change, or else you'll break ALL javascript on the page.
    • You must change this line as follows:

    • Before:
          var descriptor = new ScriptControlDescriptor("namespace.class", this.ClientID);
      After:
          var descriptor = new ScriptControlDescriptor("namespace.class", someOtherControl.ClientID);
      The problem is that user controls do not, per se, have an associated HTML control, so it's necessary to place the control's contents inside a Panel. If you do try to create a descriptor using "this", the un-handled error resulting from the $create() call on the client will cause all page-initialization-related Javascript that runs after that point to fail, thus breaking the page in a big way.

Tuesday, April 07, 2009

GWT Designer, ScriptSharp, Ext JS

Some AJAX things I've been eyeing. Microsoft AJAX just isn't good for certain things, although it's nice.