{"action":"created","issue":{"url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/14381","repository_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs","labels_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/14381/labels{/name}","comments_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/14381/comments","events_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/14381/events","html_url":"https://github.com/MicrosoftDocs/azure-docs/issues/14381","id":356213847,"node_id":"MDU6SXNzdWUzNTYyMTM4NDc=","number":14381,"title":"client_secret required or optional for OAuth2 authorization code flow","user":{"login":"jongiddy","id":3735327,"node_id":"MDQ6VXNlcjM3MzUzMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/3735327?v=4","gravatar_id":"","url":"https://api.github.com/users/jongiddy","html_url":"https://github.com/jongiddy","followers_url":"https://api.github.com/users/jongiddy/followers","following_url":"https://api.github.com/users/jongiddy/following{/other_user}","gists_url":"https://api.github.com/users/jongiddy/gists{/gist_id}","starred_url":"https://api.github.com/users/jongiddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jongiddy/subscriptions","organizations_url":"https://api.github.com/users/jongiddy/orgs","repos_url":"https://api.github.com/users/jongiddy/repos","events_url":"https://api.github.com/users/jongiddy/events{/privacy}","received_events_url":"https://api.github.com/users/jongiddy/received_events","type":"User","site_admin":false},"labels":[{"id":646555990,"node_id":"MDU6TGFiZWw2NDY1NTU5OTA=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/active-directory/svc","name":"active-directory/svc","color":"0040cc","default":false},{"id":836703193,"node_id":"MDU6TGFiZWw4MzY3MDMxOTM=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/cxp","name":"cxp","color":"bf1394","default":false},{"id":836704904,"node_id":"MDU6TGFiZWw4MzY3MDQ5MDQ=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/doc-bug","name":"doc-bug","color":"84edbc","default":false},{"id":836703308,"node_id":"MDU6TGFiZWw4MzY3MDMzMDg=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/in-progress","name":"in-progress","color":"c1d9ff","default":false},{"id":836702742,"node_id":"MDU6TGFiZWw4MzY3MDI3NDI=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/triaged","name":"triaged","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":{"login":"MohitGargMSFT","id":32749549,"node_id":"MDQ6VXNlcjMyNzQ5NTQ5","avatar_url":"https://avatars3.githubusercontent.com/u/32749549?v=4","gravatar_id":"","url":"https://api.github.com/users/MohitGargMSFT","html_url":"https://github.com/MohitGargMSFT","followers_url":"https://api.github.com/users/MohitGargMSFT/followers","following_url":"https://api.github.com/users/MohitGargMSFT/following{/other_user}","gists_url":"https://api.github.com/users/MohitGargMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/MohitGargMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MohitGargMSFT/subscriptions","organizations_url":"https://api.github.com/users/MohitGargMSFT/orgs","repos_url":"https://api.github.com/users/MohitGargMSFT/repos","events_url":"https://api.github.com/users/MohitGargMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/MohitGargMSFT/received_events","type":"User","site_admin":false},"assignees":[{"login":"MohitGargMSFT","id":32749549,"node_id":"MDQ6VXNlcjMyNzQ5NTQ5","avatar_url":"https://avatars3.githubusercontent.com/u/32749549?v=4","gravatar_id":"","url":"https://api.github.com/users/MohitGargMSFT","html_url":"https://github.com/MohitGargMSFT","followers_url":"https://api.github.com/users/MohitGargMSFT/followers","following_url":"https://api.github.com/users/MohitGargMSFT/following{/other_user}","gists_url":"https://api.github.com/users/MohitGargMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/MohitGargMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MohitGargMSFT/subscriptions","organizations_url":"https://api.github.com/users/MohitGargMSFT/orgs","repos_url":"https://api.github.com/users/MohitGargMSFT/repos","events_url":"https://api.github.com/users/MohitGargMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/MohitGargMSFT/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-09-01T16:11:09Z","updated_at":"2018-09-05T20:14:42Z","closed_at":"2018-09-05T20:14:42Z","author_association":"NONE","body":"\r\nhttps://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-access-token says that `client_secret` is optional and should not be used for native apps. However, I cannot get it to work without the client secret.\r\n\r\nFor example, the code at https://github.com/jongiddy/oauth2-rs/blob/pkce/examples/msgraph.rs using a client secret works. If I change https://github.com/jongiddy/oauth2-rs/blob/1f8f0dbd98560ff79fa9302ce8540a8d6c106ed9/examples/msgraph.rs#L61 from `Some(graph_client_secret)` to `None`, then no `client_secret` is passed in the token exchange request. I have verified that this is the case using `mitmproxy`.\r\n\r\nHowever, I get the response:\r\n```\r\nErr(ServerResponse(ErrorResponse { error: invalid_client, error_description: Some(\"AADSTS70002: The provided value for the \\'client_secret\\' parameter is not valid.\\r\\nTrace ID: 3b7cdbfb-fb25-42c3-8b63-b9dbbf400c00\\r\\nCorrelation ID: 51b6471c-574b-4c45-97bc-b9684950f5b6\\r\\nTimestamp: 2018-09-01 15:05:54Z\"), error_uri: None }))\r\n```\r\n\r\nNote that https://docs.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth#step-2-redeem-the-code-for-access-tokens provides the same OAuth2 endpoints and workflow, but states that the `client_secret` is a required parameter.\r\n\r\nIs there an app configuration that makes `client_secret` optional for native apps?\r\n\r\n---\r\n#### Document Details\r\n\r\n⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*\r\n\r\n* ID: fef99ca3-72bb-2c48-a62b-9ff9c314d72b\r\n* Version Independent ID: e58fd3a1-0af8-6e16-3d78-3dc748992593\r\n* Content: [Azure AD v2.0 OAuth Authorization Code Flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow)\r\n* Content Source: [articles/active-directory/develop/v2-oauth2-auth-code-flow.md](https://github.com/Microsoft/azure-docs/blob/master/articles/active-directory/develop/v2-oauth2-auth-code-flow.md)\r\n* Service: **active-directory**\r\n* GitHub Login: @CelesteDG\r\n* Microsoft Alias: **celested**"},"comment":{"url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/comments/418866277","html_url":"https://github.com/MicrosoftDocs/azure-docs/issues/14381#issuecomment-418866277","issue_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/14381","id":418866277,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODg2NjI3Nw==","user":{"login":"MohitGargMSFT","id":32749549,"node_id":"MDQ6VXNlcjMyNzQ5NTQ5","avatar_url":"https://avatars3.githubusercontent.com/u/32749549?v=4","gravatar_id":"","url":"https://api.github.com/users/MohitGargMSFT","html_url":"https://github.com/MohitGargMSFT","followers_url":"https://api.github.com/users/MohitGargMSFT/followers","following_url":"https://api.github.com/users/MohitGargMSFT/following{/other_user}","gists_url":"https://api.github.com/users/MohitGargMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/MohitGargMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MohitGargMSFT/subscriptions","organizations_url":"https://api.github.com/users/MohitGargMSFT/orgs","repos_url":"https://api.github.com/users/MohitGargMSFT/repos","events_url":"https://api.github.com/users/MohitGargMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/MohitGargMSFT/received_events","type":"User","site_admin":false},"created_at":"2018-09-05T20:14:42Z","updated_at":"2018-09-05T20:14:42Z","author_association":"MEMBER","body":"@jongiddy We will now proceed to close this thread. If there are further questions regarding this matter, please open a new issue and we will gladly continue the discussion."}}
{"actor":{"display_login":"MohitGargMSFT"}}