Skip to content

Commit

Permalink
feat: Improve Passwordless Flow, and set Asymc enc
Browse files Browse the repository at this point in the history
  • Loading branch information
EntraptaJ authored Sep 22, 2021
1 parent 40629a4 commit 3486197
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 21 deletions.
9 changes: 2 additions & 7 deletions Apps/Template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ provider "consul" {
address = "core0.site1.kristianjones.dev:8500"
}

provider "authentik" {
url = var.URL
token = var.Token
# Optionally set insecure to ignore TLS Certificates
# insecure = true
}

resource "authentik_application" "Application" {
name = "${var.AppName}"
slug = "${var.AppName}-auth"
Expand All @@ -71,6 +64,8 @@ resource "authentik_provider_oauth2" "OID" {
client_secret = random_password.ClientSecret.result

authorization_flow = var.AuthorizationFlow.UUID

jwt_alg = "RS256"
}

resource "authentik_policy_expression" "policy" {
Expand Down
20 changes: 12 additions & 8 deletions Apps/Template/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ variable "AppName" {
type = string
}

variable "AuthorizationFlow" {
type = object({
UUID = string
variable "OpenID" {
value = object({
URL = string

RedirectURL = any
})
}

variable "URL" {
type = string
default = {
URL = "https://auth.kristianjones.dev"
}
}

variable "Token" {
type = string
variable "AuthorizationFlow" {
type = object({
UUID = string
})
}

variable "VaultPath" {
Expand Down
16 changes: 14 additions & 2 deletions Flows/BasePasswordless/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ terraform {
}
}

resource "authentik_stage_identification" "UserIdentification" {
name = "person-ident"
user_fields = ["username", "email"]
}

resource "authentik_stage_authenticator_webauthn" "Passwordless" {
name = "basewebauthn-passwordless-core"
}
Expand All @@ -29,8 +34,15 @@ resource "authentik_flow" "Flow" {
designation = "authorization"
}

resource "authentik_flow_stage_binding" "FlowBinding" {
resource "authentik_flow_stage_binding" "UserIdentification" {
target = authentik_flow.Flow.uuid
stage = authentik_stage_authenticator_webauthn.Passwordless.id

stage = authentik_stage_identification.UserIdentification.id
order = 0
}

resource "authentik_flow_stage_binding" "WebAuthnBinding" {
target = authentik_flow.Flow.uuid
stage = authentik_stage_authenticator_webauthn.Passwordless.id
order = 10
}
21 changes: 17 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,28 @@ module "BasePasswordlessFlow" {
# Applications
#

#
# Pomerium
#

module "PomeriumApp" {
source = "./Apps/Template"

AppName = "pomeriumproxy"

AuthorizationFlow = module.BasePasswordlessFlow.Flow

URL = module.Vault.Authentik.URL
Token = module.Vault.Authentik.Token

VaultPath = module.Vault.Authentik.VaultPath
}

OpenID = {
URL = "https://auth.kristianjones.dev"
}
}

#
# Hashicorp
#

#
# Hashicorp Vault
#

0 comments on commit 3486197

Please sign in to comment.