Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create a TrustFrameworkKeySet and TrustFrameworkKey at the same time #885

Open
greiggs opened this issue Aug 23, 2024 · 0 comments
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@greiggs
Copy link

greiggs commented Aug 23, 2024

Describe the bug

I am trying to create a TrustFrameworkKeySet and TrustFrameworkKey at the same time using Microsoft.Identity.Web.GraphServiceClientBeta version 3.0.1 which is using Microsoft.Graph.Beta 5.78.0-preview. I get the following error:
The 'keySet' field is invalid in request. Please check the request body and parameters.

Expected behavior

To create a TrustFrameworkKey while creating a TrustFrameworkKeySet using the follow guide trustframework-post-keysets.

How to reproduce

Where:
secret - the key to add
name - name of the key to create
graphServiceClient - Microsoft.Graph.Beta.GraphServiceClient

TrustFrameworkKeySetCollectionResponse? keySets = await graphServiceClient.TrustFramework.KeySets.GetAsync(cancellationToken: cancellationToken);

TrustFrameworkKeySet? trustFrameworkKeySet = keySets?.Value?.FirstOrDefault(x => x.Id == name);

if (trustFrameworkKeySet == null)
{
    trustFrameworkKeySet = new()
    {
        Id = name,
        Keys =
        [
            new TrustFrameworkKey()
            {
                Use = "sig",
                K = secret,
                Kty = "oct"
            }
        ]
    };

    trustFrameworkKeySet = await graphServiceClient.TrustFramework.KeySets.PostAsync(trustFrameworkKeySet, cancellationToken: cancellationToken);
}

SDK Version

5.78.0-preview

Latest version known to work for scenario above?

No response

Known Workarounds

I am able to create the TrustFrameworkKeySet then Upload a secret separately but it always creates a .bak key.

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@greiggs greiggs added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

1 participant