Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Unable to create a new Conditional Access authentication context object

Aberta
#3,464 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
powershell
Domínio
api

Direção de pesquisa

Comece reproduzindo a resposta 405 com New-MgIdentityConditionalAccessAuthenticationContextClassReference e o exemplo de BodyParameter da documentação vinculada do Microsoft Graph. Compare os cmdlets de produção e beta e suas operações HTTP documentadas. Considera-se concluído quando o fluxo de criação compatível cria com êxito um contexto de autenticação com o id, o nome de exibição e as configurações de disponibilidade fornecidos.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Status: Needs Investigation type:bug
Describe the bug

When trying to create a new authentication context I get an error

New-MgIdentityConditionalAccessAuthenticationContextClassReference_CreateExpanded: Specified method is not allowed. Try GET, PATCH, DELETE

I tried to create it directly and using the BodyParameter.

New-MgIdentityConditionalAccessAuthenticationContextClassReference -DisplayName 'test context' -Id 'c2' -IsAvailable

and using the example in the MS docs link below.

This is an article for the beta module, the prod one doesn't have an example for whatever reason.

https://learn.microsoft.com/en-us/powershell/module/Microsoft.Graph.Beta.Identity.SignIns/New-MgBetaIdentityConditionalAccessAuthenticationContextClassReference?view=graph-powershell-beta#example-1-code-snippet

Expected behavior

Expected behavior is that the authentication context object gets created with the object id, name displayed.

How to reproduce

Run either of those:

New-MgIdentityConditionalAccessAuthenticationContextClassReference -DisplayName 'test authentication context' -Id 'c2' -IsAvailable
$AuthenticationContextBody = @{
	id = 'c2'
	displayName = 'test authentication context'
	isAvailable = $true
}

New-MgBetaIdentityConditionalAccessAuthenticationContextClassReference -BodyParameter $AuthenticationContextBody
SDK Version

2.33.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log

New-MgIdentityConditionalAccessAuthenticationContextClassReference_CreateExpanded: Specified method is not allowed. Try GET, PATCH, DELETE

Status: 405 (MethodNotAllowed)
ErrorCode: MethodNotAllowed
Date: 2025-12-11T09:21:28

Headers:
Cache-Control                 : no-cache
Vary                          : Accept-Encoding
Strict-Transport-Security     : max-age=31536000
request-id                    : 8003e512-0000-0000-0000-a800072bd353
client-request-id             : 000c793b-0000-0000-0000-a8005b5050b2
x-ms-ags-diagnostic           : {"ServerInfo":{"DataCenter":"Sweden Central","Slice":"E","Ring":"3","ScaleUnit":"002","RoleInstance":"GV3PEPF00002BC3"}}
Date                          : Thu, 11 Dec 2025 09:21:27 GMT


  Recommendation: See service error codes: https://learn.microsoft.com/graph/errors

Configuration
PSVersion                      7.5.4
PSEdition                      Core
OS                             Microsoft Windows 10.0.22631
Other information

No response

Linguagem predominante
C#
Estrelas
903
Forks
235
Merge médio
1d 23h
PRs com merge (30d)
22

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de microsoftgraph/msgraph-sdk-powershell

Todas as issues de microsoftgraph/msgraph-sdk-powershell

Issues semelhantes

Mais issues de C#

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.