Exemplo n.º 1
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            symplifiedSamlSection = new Section("Salesforce OAuth/SAML2 Grant");
            symplifiedSamlSection.Add(new StyledStringElement("Exchange Assertion", PerformSalesforceOAuthSaml2Grant));

            samlLoginStatusStringElement               = new StyledStringElement(String.Empty, "SAML 2.0 Assertion Subject", UITableViewCellStyle.Subtitle);
            samlLoginStatusStringElement.Lines         = 1;
            samlLoginStatusStringElement.LineBreakMode = UILineBreakMode.TailTruncation;
            samlLoginStatusStringElement.Font          = UIFont.SystemFontOfSize(12.0f);
            samlLoginStatusStringElement.SubtitleFont  = UIFont.SystemFontOfSize(10.0f);
            symplifiedSamlSection.Add(samlLoginStatusStringElement);

            accessTokenStringElement               = new StyledStringElement("", "OAuth 2 Access Token", UITableViewCellStyle.Subtitle);
            accessTokenStringElement.Lines         = 1;
            accessTokenStringElement.LineBreakMode = UILineBreakMode.TailTruncation;
            accessTokenStringElement.Font          = UIFont.SystemFontOfSize(12.0f);
            accessTokenStringElement.SubtitleFont  = UIFont.SystemFontOfSize(10.0f);
            symplifiedSamlSection.Add(accessTokenStringElement);

            scopeStringElement               = new StyledStringElement("", "Scope", UITableViewCellStyle.Subtitle);
            scopeStringElement.Lines         = 1;
            scopeStringElement.LineBreakMode = UILineBreakMode.TailTruncation;
            scopeStringElement.Font          = UIFont.SystemFontOfSize(12.0f);
            scopeStringElement.SubtitleFont  = UIFont.SystemFontOfSize(10.0f);
            symplifiedSamlSection.Add(scopeStringElement);

            jsonResponseElement = new JsonStringElement("");
            jsonResponseElement.LineBreakMode = UILineBreakMode.WordWrap;
            jsonResponseElement.Font          = UIFont.SystemFontOfSize(12.0f);
            symplifiedSamlSection.Add(jsonResponseElement);

            RootElement menuRoot = new RootElement("OAuthSaml2BearerExampleiOS");

            menuRoot.Add(symplifiedSamlSection);
            menuRoot.UnevenRows = true;

            loginViewController = new DialogViewController(UITableViewStyle.Grouped, menuRoot);

            window.RootViewController = loginViewController;
            window.MakeKeyAndVisible();

            return(true);
        }
Exemplo n.º 2
0
		//
		// This method is invoked when the application has loaded and is ready to run. In this 
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		//
		// You have 17 seconds to return from this method, or iOS will terminate your application.
		//
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			symplifiedSamlSection = new Section ("Salesforce OAuth/SAML2 Grant");
			symplifiedSamlSection.Add (new StyledStringElement ("Exchange Assertion", PerformSalesforceOAuthSaml2Grant));

			samlLoginStatusStringElement = new StyledStringElement (String.Empty, "SAML 2.0 Assertion Subject", UITableViewCellStyle.Subtitle);
			samlLoginStatusStringElement.Lines = 1;
			samlLoginStatusStringElement.LineBreakMode = UILineBreakMode.TailTruncation;
			samlLoginStatusStringElement.Font = UIFont.SystemFontOfSize (12.0f);
			samlLoginStatusStringElement.SubtitleFont = UIFont.SystemFontOfSize (10.0f);
			symplifiedSamlSection.Add (samlLoginStatusStringElement);

			accessTokenStringElement = new StyledStringElement ("", "OAuth 2 Access Token", UITableViewCellStyle.Subtitle);
			accessTokenStringElement.Lines = 1;
			accessTokenStringElement.LineBreakMode = UILineBreakMode.TailTruncation;
			accessTokenStringElement.Font = UIFont.SystemFontOfSize (12.0f);
			accessTokenStringElement.SubtitleFont = UIFont.SystemFontOfSize (10.0f);
			symplifiedSamlSection.Add (accessTokenStringElement);

			scopeStringElement = new StyledStringElement ("", "Scope", UITableViewCellStyle.Subtitle);
			scopeStringElement.Lines = 1;
			scopeStringElement.LineBreakMode = UILineBreakMode.TailTruncation;
			scopeStringElement.Font = UIFont.SystemFontOfSize (12.0f);
			scopeStringElement.SubtitleFont = UIFont.SystemFontOfSize (10.0f);
			symplifiedSamlSection.Add (scopeStringElement);

			jsonResponseElement = new JsonStringElement ("");
			jsonResponseElement.LineBreakMode = UILineBreakMode.WordWrap;
			jsonResponseElement.Font = UIFont.SystemFontOfSize (12.0f);
			symplifiedSamlSection.Add (jsonResponseElement);

			RootElement menuRoot = new RootElement ("OAuthSaml2BearerExampleiOS");
			menuRoot.Add (symplifiedSamlSection);
			menuRoot.UnevenRows = true;

			loginViewController = new DialogViewController (UITableViewStyle.Grouped, menuRoot);

			window.RootViewController = loginViewController;
			window.MakeKeyAndVisible ();
			
			return true;
		}