public RequestAuthorization(ICredentials credentials, IScopes requestedScopes) : base( "api/v1/auth/token", HttpMethod.Post, "grant_type=client_credentials" + $"&client_id={credentials.Identifier()}" + $"&client_secret={credentials.Secret()}" + $"&scope={string.Join(" ", requestedScopes.Required())}") { }
private AuthenticationHeaderValue CreateAuthorization(ResourceBase value, HttpRequestMessage request) => new AuthenticationHeaderValue( "Onnistuu", m_credentials.Identifier() + ":" + Convert.ToBase64String( m_macHash.ComputeHash( Encoding.UTF8.GetBytes( string.Join( "\n", request.Method.ToString(), Base64Content(request.Content), ContentType(request.Content), GetRequestTime(request), "/" + value.ResourceUri) ) ) ) );