Skip to content

Instantly share code, notes, and snippets.

View keoy7am's full-sized avatar
🏠
Work at home

Elliot Chen keoy7am

🏠
Work at home
  • Taipei,Taiwan
  • 16:28 (UTC +08:00)
View GitHub Profile
@SteveSandersonMS
SteveSandersonMS / blazor-auth.md
Created June 11, 2019 10:49
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

@walterlv
walterlv / SelfInstaller.cs
Created February 27, 2019 02:37
这是一个简单的自更新程序的类。使用此类型,程序初次运行的时候会安装自己,如果已安装旧版本会更新自己,如果已安装最新则直接运行。
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security.Principal;
namespace Walterlv.Installing
{
@esilvajr
esilvajr / image_phpstorm_server.png
Last active November 12, 2024 04:17
How to use XDebug inside a docker container.
image_phpstorm_server.png
@thoop
thoop / nginx.conf
Last active April 14, 2025 17:11
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@kirpit
kirpit / bash.py
Last active March 17, 2023 06:29
Enables to run subprocess commands in a different thread with TIMEOUT option!
#! /usr/bin/env python
import threading
import subprocess
import traceback
import shlex
class Command(object):
"""
Enables to run subprocess commands in a different thread with TIMEOUT option.