Skip to content

Instantly share code, notes, and snippets.

@robotdan
robotdan / PasswordChecker.js
Created March 20, 2023 23:30
Example Dynamic password validation script
class FusionAuthPasswordChecker {
#minLength;
#maxLength;
#passwordField;
#requireMixedCase;
#requireNonAlpha;
#requireNumber;
#timer;
constructor(minLength, maxLength, requireMixedCase, requireNonAlpha, requireNumber) {
@robotdan
robotdan / EmailValidator.java
Created May 21, 2021 19:19
FusionAuth Email Validator
/*
* Copyright (c) 2021, Inversoft Inc., All Rights Reserved
*/
package com.inversoft.validator;
/**
* @author Daniel DeGroff
*/
public class EmailValidator {
@robotdan
robotdan / logback.xml
Created July 10, 2019 15:16
FusionAuth log configuration with DEBUG enabled
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{"MMM dd, yyyy h:mm:ss.SSS a"} %-5level %logger{75} - %msg%n</pattern>
</encoder>
</appender>
@robotdan
robotdan / OAuth1AuthorizationHeaderBuilder.java
Last active August 6, 2023 08:41
OAuth v1 Authorization Builder
/*
* Copyright (c) 2019, FusionAuth, All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
package com.inversoft.util;
import java.security.SecureRandom;
import java.util.Base64;
/**
* @author Daniel DeGroff
*/
public class SecurityTools {

Keybase proof

I hereby claim:

  • I am robotdan on github.
  • I am robotdan (https://keybase.io/robotdan) on keybase.
  • I have a public key whose fingerprint is 0499 9BC2 9C8C 780F 621C AD2A 9C81 4FCA 8378 1BFB

To claim this, I am signing this object:

@robotdan
robotdan / passport-client-snippet.csharp
Last active May 25, 2016 14:29
PassportClient Code Snippets
/* Authenticate a User */
ClientResponse<LoginResponse, Errors> response = client.Login(
new LoginRequest(new Guid("00000000-0000-0000-0000-00000000002a"), "[email protected]", null, "secret"), null);
User user = response.successResponse.user;
/* Retrieve User by Email Address */
ClientResponse<UserResponse, Errors> response = client.RetrieveUserByEmail("[email protected]");
User user = response.successResponse.user;