Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by kyperevozchikov · Jan 25, 2019 at 01:50 PM · windowsauthentication

How to use current user (Logged in user under Windows) credentials to connect web-server under IIS with Windows Authentication

Hello, I want to get data from a web-server (IIS) where Windows Authentication is enabled without additional prompt to the user to type its login and password.

  • I tried to set HttpWebRequest.UseDefaultCredentials = true

  • I tried to use WindowsIdentity (Impersonate, for example) to fill HttpWebRequest.UseDefaultCredentials = true and HttpWebRequest.Credentials = CredentialsCache.DefaultCredentials

  • I tried to use CredentialCache.DefaultCredentials

But all these methods do not work. Server returns the 401 Unauthorized.

I use Unity 2018.3.2 and tried varios combinations of the settings for the unity player like .Net 4.x, Mono/IL2CPP, .Net Standard 2.0/.Net 4.x

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image $$anonymous$$ · Oct 03, 2019 at 05:52 AM 0
Share

Hi Guys,

I wanted to implement the same for a Windows standalone build.

$$anonymous$$y requirement is to authenticate the current user, with his windows login.

Can i implement the code shared here or does it need any changes?

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by kyperevozchikov · Feb 01, 2019 at 09:54 AM

FYI, All listed methods above don't work because they all executed under Mono runtime. I just have implemented simple native (C++) dll which use WinHTTP library to get/post data with autologon to servers under Windows Authentications in our intranet (same domain) on Windows standalone Unity platform. That is all I was needed to.

If you are interested I publish project to github under open source license.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Wim-Wouters · May 16, 2019 at 08:10 AM 0
Share

Very interesting! $$anonymous$$y C++ skill's are non-existent, so I would be very interested in testing your WinHTTP implementation. Hope you still publish to github! :)

avatar image kyperevozchikov Wim-Wouters · May 18, 2019 at 05:08 AM 0
Share

It is already on github ;) Repo is "kyperevozchikov/WinHttpUnityPlugin"

avatar image Wim-Wouters · May 18, 2019 at 06:44 PM 0
Share

Super! Checking it out in a $$anonymous$$ute! :)

avatar image MikeWise · Jul 20, 2019 at 11:39 PM 0
Share

Have a link to that github repo?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

106 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity behind proxy + windows authentication 0 Answers

Speech to text 2 Answers

Mac OSX on windows and building out for iphone/ipad? 2 Answers

Change in functionality in windows build 0 Answers

How to get result message from System.Diagnostics.Process 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges