Portfolio.Web 1.0.0.0
.NET, Blazor, WPF와 서비스 운영 경험을 프로젝트·이력·기술 스택 단위로 보여주는 개발자 포트폴리오입니다.
로딩중...
검색중...
일치하는것 없음
PortfolioApp.Services.PortfolioUserContext 클래스 참조sealed

더 자세히 ...

Public 멤버 함수

 PortfolioUserContext (AuthenticationStateProvider authenticationStateProvider)
async Task< PortfolioCurrentUserGetCurrentAsync ()

Private 속성

readonly AuthenticationStateProvider _authenticationStateProvider

상세한 설명

Portfolio User Context 기능과 관련 상태를 캡슐화합니다.

PortfolioUserContext.cs 파일의 50 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ PortfolioUserContext()

PortfolioApp.Services.PortfolioUserContext.PortfolioUserContext ( AuthenticationStateProvider authenticationStateProvider)
inline

지정한 설정으로 PortfolioUserContext 클래스의 새 인스턴스를 초기화합니다.

매개변수
authenticationStateProviderauthentication State Provider에 사용할 AuthenticationStateProvider 값입니다.

PortfolioUserContext.cs 파일의 78 번째 라인에서 정의되었습니다.

79 {
80 _authenticationStateProvider = authenticationStateProvider;
81 }

다음을 참조함 : _authenticationStateProvider.

멤버 함수 문서화

◆ GetCurrentAsync()

async Task< PortfolioCurrentUser > PortfolioApp.Services.PortfolioUserContext.GetCurrentAsync ( )
inline

Current Async 값을 가져옵니다.

반환값
Get Current Async 작업에서 생성한 Task<PortfolioCurrentUser> 결과입니다.

PortfolioUserContext.cs 파일의 99 번째 라인에서 정의되었습니다.

100 {
101 var state = await _authenticationStateProvider.GetAuthenticationStateAsync().ConfigureAwait(false);
102 var principal = state.User;
103
104 if (principal.Identity?.IsAuthenticated != true)
105 {
106 return PortfolioCurrentUser.Anonymous;
107 }
108
109 string userId = principal.FindFirstValue(DreamineIdentityExtensions.UserIdClaimType) ?? string.Empty;
110 if (string.IsNullOrWhiteSpace(userId))
111 {
112 return PortfolioCurrentUser.Anonymous;
113 }
114
115 string provider = principal.FindFirstValue(DreamineIdentityExtensions.ProviderClaimType) ?? "Local";
116 string email = principal.FindFirstValue(ClaimTypes.Email) ?? string.Empty;
117 string displayName = principal.FindFirstValue(ClaimTypes.Name) ?? email;
118
119 return new PortfolioCurrentUser(
120 $"oauth-{userId}",
121 provider,
122 email,
123 displayName);
124 }
record PortfolioCurrentUser(string Id, string Provider, string Email, string DisplayName)

다음을 참조함 : _authenticationStateProvider, PortfolioApp.Services.PortfolioCurrentUser().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ _authenticationStateProvider

readonly AuthenticationStateProvider PortfolioApp.Services.PortfolioUserContext._authenticationStateProvider
private

authentication State Provider 값을 보관합니다.

PortfolioUserContext.cs 파일의 60 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : GetCurrentAsync(), PortfolioUserContext().


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: