Packages
samly
0.8.3
1.4.0
1.3.0
1.2.0
1.1.0
1.0.0
1.0.0-rc.1
retired
1.0.0-rc.0
retired
0.10.1
retired
0.10.0
retired
0.9.3
retired
0.9.2
retired
0.9.1
retired
0.9.0
retired
0.8.4
retired
0.8.3
retired
0.8.2
retired
0.8.1
retired
0.8.0
retired
0.7.2
retired
0.7.1
retired
0.7.0
retired
0.6.3
retired
0.6.2
retired
0.6.1
retired
0.6.0
retired
0.5.0
retired
0.4.0
retired
0.1.2
retired
SAML Single-Sign-On Authentication for Plug/Phoenix Applications
Retired package: Use versions >= 1.0.0
Current section
Files
Jump to
Current section
Files
lib/samly/subject.ex
defmodule Samly.Subject do
@moduledoc """
The subject in a SAML 2.0 Assertion.
This is part of the `Samly.Assertion` struct. The `name` field in this struct should not
be used any UI directly. It might be a temporary randomly generated
ID from IdP. `Samly` internally uses this to deal with IdP initiated logout requests.
"""
require Samly.Esaml
alias Samly.Esaml
defstruct name: "",
confirmation_method: :bearer,
notonorafter: ""
@type t :: %__MODULE__{
name: String.t(),
confirmation_method: atom,
notonorafter: String.t()
}
@doc false
def from_rec(subject_rec) do
Esaml.esaml_subject(
name: name,
confirmation_method: confirmation_method,
notonorafter: notonorafter
) = subject_rec
%__MODULE__{
name: name |> List.to_string(),
confirmation_method: confirmation_method,
notonorafter: notonorafter |> List.to_string()
}
end
end