public TokenResponse GenerateToken(string sub) { return(new TokenResponse { access_token = LocalAuthentication.GenerateProfileAccessToken(sub) }); }
public TokenResponse GenerateToken([FromForm] TokenRequest request) { if (request?.client_id == null) { throw new InvalidOperationException("Client id is not supplied in token request."); } return(new TokenResponse { access_token = LocalAuthentication.GenerateServiceAccessToken(request.client_id) }); }
public ActionResult GenerateToken(string sub, string[] scopes) { if (!DebugHelpers.IsDevelopment()) { return(NotFound()); } if (string.IsNullOrWhiteSpace(sub)) { return(BadRequest("Sub (user ID) should not be empty.")); } return(Ok(new { access_token = LocalAuthentication.GenerateProfileAccessToken($"local-auth_{sub}", scopes) })); }
public Task <AuthStartResult> AuthorizeStart(LocalAuthentication LocalAuthentication, ChargingLocation ChargingLocation = null, ChargingProduct ChargingProduct = null, ChargingSession_Id?SessionId = null, ChargingSession_Id?CPOPartnerSessionId = null, ChargingStationOperator_Id?OperatorId = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) { throw new NotImplementedException(); }
public ValueTask <string> SignInAsync() { return(new ValueTask <string>(LocalAuthentication.GenerateProfileAccessToken(_profile))); }
public ValueTask <string> SignInAsync(CancellationToken cancellationToken) { return(new ValueTask <string>(LocalAuthentication.GenerateProfileAccessToken(_profile, Array.Empty <string>()))); }