GithubHelp home page GithubHelp logo

active-directory-xamarin-ios's Introduction

This sample has been archived

DEPRECATION NOTE: ADAL v3 has been released and offers a better experience using Xamarin with iOS than this sample.

We recommend you use the new ADAL v3 walkthrough https://github.com/Azure-Samples/active-directory-dotnet-native-multitarget unless you have a specific reason for requiring the binding of the native iOS library in your Xamarin application.

If you really wish to view the archived sample, please switch to the archive branch. This code is no longer maintained and functionality is not guaranteed.

active-directory-xamarin-ios's People

Contributors

acomsmpbot avatar brandwe avatar carlosfigueira avatar danieldobalian avatar dstrockis avatar gsacavdm avatar jmprieur avatar ninjadev123 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

active-directory-xamarin-ios's Issues

The type or namespace name `ADTokenCacheStoring' could not be found

I’m trying to create the .dll for the ADAL library to use with our multi platform application developed in Visual Studio. The sample (https://github.com/AzureADSamples/NativeClient-Xamarin-iOS) is the only usable information I’ve been able to find on how to bind the libADALiOS.a. Big thanks for that!

I am however stuck when trying to compile the sample library :( Xamarin Studio on OSX gives me two errors:

  • [FILEPATH]/ADAuthenticationContext.g.cs(77,77): Error CS0246: The type or namespace name `ADTokenCacheStoring' could not be found. Are you missing an assembly reference? (CS0246) (Binding)
    adauthenticationsettings error
  • [FILEPATH]/ADAuthenticationSettings.g.cs(18,18): Error CS0246: The type or namespace name `ADTokenCacheStoring' could not be found. Are you missing an assembly reference? (CS0246) (Binding)
    adauthenticationcontext error

I managed to build the solution into a dll file by changing some stuff. I moved the ADCredentialsType enum in ApiDefinitions.cs to StructsAndEnums.cs and changed the:

[Model]
public partial interface ADTokenCacheStoring {

into:

[BaseType (typeof (NSObject))]
[Model]
public partial interface ADTokenCacheStoring {

I also had to change the Field attributes in ADTokenCacheStoring from:

[Field ("ADAuthenticationErrorDomain”)]

into:

[Field (“ADAuthenticationErrorDomain”, “__internal”)]

After these changes it compiles into a +1mb dll file with success. Once inside the Visual Studio project I get an error when calling the constructor of ADAuthenticationContext with a "new ADTokenCacheStoring()" as the tokenCache. I’ve also tried providing "null" as the tokenCache but without success. I don't fully understand what implications my changes had and I would guess that my changes causes the ADAuthenticationContext constructor to fail in Visual Studio.

Any help you can provide or direction you can point me in would be tremendously helpful. Should I be able to compile the NativeClient-Xamarin-iOS project? I’ve also tried to compile a new libADALiOS.a library and added it to the NativeClient-Xamarin-iOS project but I still run into the same problem.

Many thanks in advance.
Regards,
Gustav

Logout Issue

I am Logout using the following Code

ADAuthenticationError error;
var authenticationContext = ADAuthenticationContext.AuthenticationContextWithAuthority(IdentityAuthority, out error);
authenticationContext.TokenCacheStore.RemoveAllWithError(out error);

var cookies = NSHttpCookieStorage.SharedStorage.Cookies.ToList();
foreach (var cookie in cookies)
{
NSHttpCookieStorage.SharedStorage.DeleteCookie(cookie);
}

After logout Login page is not showing and giving the following error

The user is currently prompted for credentials as result of another acquireToken request. Please retry the acquireToken call later.

Error is on this line
await authenticationContext.AcquireTokenWithResourceAsync(targetServerUrl, Id, redirectUri);

But if i close the application and reopen it login page successfully showing without any error

Have any idea about this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.