Skip to content

Instantly share code, notes, and snippets.

View hovermind's full-sized avatar
💭
Solving...

MD TAREQ HASSAN hovermind

💭
Solving...
View GitHub Profile
@hovermind
hovermind / blazor-auth.md
Created July 8, 2021 09:50 — forked from SteveSandersonMS/blazor-auth.md
Blazor authentication and authorization

Authentication and Authorization

Authentication means determining who a particular user is. Authorization means applying rules about what they can do. Blazor contains features for handling both aspects of this.

It worth remembering how the overall goals differ between server-side Blazor and client-side Blazor:

  • Server-side Blazor applications run on the server. As such, correctly-implemented authorization checks are both how you determine which UI options to show (e.g., which menu entries are available to a certain user) and where you actually enforce access rules.
  • Client-side Blazor applications run on the client. As such, authorization is only used as a way of determining what UI options to show (e.g., which menu entries). The actual enforcement of authorization rules must be implemented on whatever backend server your application operates on, since any client-side checks can be modified or bypassed.

Authentication-enabled templates for Server-Side Blazor

@hovermind
hovermind / AudioUtil.swift
Last active June 18, 2020 14:33
LinearPCMRecording class in AudioUtil
/**
Leaner PCM recording setting model
This class represents Linear PCM recording related settings
*/
public class LinearPCMRecording {
//
// these constants are only to avoid magic numbers
//
private static let SAMPLE_RATE_16_KHZ = 16_000
#FYI - this is where the vault is created:
#Running as Admin: C:\ProgramData\ACMESharp\sysVault
#Running as User: C:\Users\NAME\AppData\Local\ACMESharp\userVault
Import-Module ACMESharp
$domain = "DOMAINNAME"
$email = "CONTACTEMAIL"
$certOutput = "C:\CertOutput\{0}\{1}" -f $domain, [guid]::NewGuid()
mkdir $certOutput
cd $certOutput
Import-Module -Name D:\Temp\ACME-posh\ACMEPowerShell.psd1
$domain = "mydomain.com"
$certificiatePassword = "abcd1234"
$email = "letsencrypt@mydomain.com"
$vault = "D:\Vault\{0}\{1}" -f $domain, [guid]::NewGuid()
mkdir $vault
cd $vault
Initialize-ACMEVault -BaseURI https://acme-v01.api.letsencrypt.org/
New-ACMERegistration -Contacts mailto:$email
@hovermind
hovermind / hover.txt
Last active December 9, 2018 06:00
hover env
Disable-UAC
Set-ExecutionPolicy Unrestricted -Scope Process -Force
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
choco feature enable -n allowGlobalConfirmation
choco feature enable -n allowEmptyChecksums
cinst Microsoft-Hyper-V-All -source windowsFeatures
refreshenv
@hovermind
hovermind / test.ps1
Last active December 8, 2018 17:31
boxstarter test
$Boxstarter.RebootOk=$true
$Boxstarter.NoPassword=$true
$Boxstarter.AutoLogin=$true
choco feature enable -n allowGlobalConfirmation
choco feature enable -n allowEmptyChecksums
cinst battle.net
cinst steam