GithubHelp home page GithubHelp logo

wordpress-mobile / wordpressauthenticator-ios Goto Github PK

View Code? Open in Web Editor NEW
17.0 22.0 11.0 4.49 MB

License: GNU General Public License v2.0

Swift 91.35% C 0.01% Objective-C 7.73% Ruby 0.73% Shell 0.11% Makefile 0.06%

wordpressauthenticator-ios's Introduction

WordPressAuthenticator-iOS

WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps.

This framework encapsulates everything required to display the Authentication UI and perform authentication against WordPress.com and WordPress.org sites.

Plus: WordPress.com signup is supported.

Setup

# Install required ruby version
rbenv install -s

# Install bundler and Gemfile dependencies
gem install bundler
bundle install

# Install CocoaPods dependencies
bundle exec pod install

Integrating the Library with CocoaPods

WordPressAuthenticator is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "WordPressAuthenticator"

wordpressauthenticator-ios's People

Contributors

aerych avatar alisoftware avatar bjtitus avatar charliescheer avatar crazytonyli avatar ctarda avatar danielebogo avatar diegoreymendez avatar ealeksandrov avatar ecarrion avatar frosty avatar hassaansaleh avatar itsmeichigo avatar jaclync avatar jkmassel avatar jleandroperez avatar jtreanor avatar loremattei avatar mindgraffiti avatar mokagio avatar nheagy avatar oguzkocer avatar pmusolino avatar rachelmcr avatar scoutharris avatar selanthiraiyan avatar shiki avatar spencertransier avatar staskus avatar yaelirub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

wordpressauthenticator-ios's Issues

UL&S: Remove .showSelfHostedLogin

Remove the .showSelfHostedLogin storyboard segue from the storyboard and view controllers. Navigate using a navController instead.

Ref. #182

  • LoginViewController
  • enum case showURLUsernamePassword
  • Login.storyboard - 2 references

Site address option disappears after sending magic link

Expected

I should always be able to go back to a previous step in the flow and choose a different option.

Actual

If I choose the email/magic link flow, and go back after sending the magic link, the site address option disappears from the email screen. I have to go all the way back to the prologue screen and start over.

This happens in multiple apps using WordPressAuthenticator (WordPress, WooCommerce).

Steps to reproduce

These are steps to repro in WordPress:

  1. Select "Log In."
  2. Select "Continue with WordPress.com."
  3. Enter your WordPress.com account email address and select "Next."
  4. Select "Send Link."
  5. Tap back twice to return to the email screen, and notice that the option to log in with site address is gone.
Initial email screen Email screen after going back

Spike: research effort for adding tappable sites to epilogues

Ref. pauD4L-Bb-p2#comment-624

Research if it's possible to add the ability to select a site row in the My Sites table when the user reaches the login epilogue screen or the signup epilogue screen. Estimate time and add another ticket for the work.

Screen Shot 2020-02-24 at 4 05 47 PM

UL&S: Remove .showUsernames

Ref. #182

Remove the showUsernames case from the SegueIdentifiers enum. Programmatically navigate to the SignupEpilogueViewController.

This case is used in 1 area:

  1. WPiOS signup
  • WPiOS SignupEpilogue.storyboard
  • SignupEpilogueViewController
  • NUXViewController

UL&S: remove `.showGoogle`

Remove the .showGoogle storyboard segue from the storyboard and view controllers. Replace it with programmatic navigation.

Ref. #182

  • LoginEmailViewController
  • LoginPrologueViewController
  • LoginSiteAddressViewController
  • enum showGoogle
  • Login.storyboard - 3 references

Update Lottie

There's been a major new version of Lottie, and we should update to it.

Expose view controller background colors

To Do

  • Re-set the storyboard backgrounds to the default color
  • Let the host app override the background color in each view controller using UIAppearance
  • To test that it's working, assign the UIAppearance in: for each view controller in the host app (i.e., WPiOS or WCiOS)

Add prompt to logout of current account when trying to connect to a *private* WPCom site

In #45 we added a prompt asking the user to logout before trying to connect to another WPCom site if they are already logged in with a WPCom account.

The solution works for public sites but not for private ones.
The end point /sites/site being called by fetchSiteInfo is not returning information for private sites, hence not presenting the prompt.

@aerych suggested using an alternative endpoint: /connect/site-info to get the info for private sites.
The end point should work without authentication and takes a url as parameter (site to investigate) and the response should look like:

{
  "urlAfterRedirects": "https://madefortesting764.wordpress.com",
  "exists": true,
  "isWordPress": true,
  "hasJetpack": false,
  "isJetpackActive": false,
  "skipRemoteInstall": false,
  "isJetpackConnected": false,
  "isWordPressDotCom": true
}

We should use this endpoint instead in order to support both public and private sites.

Signup Flow: no magic link offered

Ref. pbArwn-an-p2

Feedback:

After entering an email to sign up with, we managed to get into a flow where a magic link was not offered. Was it because an account with that email was already configured with username and password? We should offer the magic link option whenever possible.

Currently unable to reproduce.

A console warning is observed regarding a referenced image asset

When using a WordPressAuthenticator component in WordPress-iOS, I'm seeing the following warning in the console:

2018-12-11 09:21:31.650079-0800 WordPress[91387:1155878] Could not load the "beveled-blue-button-down" image referenced from a nib in the bundle with identifier "org.cocoapods.WordPressAuthenticator"

UL&S: Remove .showLoginMethod

Remove the .showLoginMethod storyboard segue from the storyboard and view controllers. Navigate using a navController instead.

Ref. #182

  • LoginPrologueViewController
  • LoginSiteAddressViewController
  • Remove enum case showLoginMethod from NUXViewController
  • Login.storyboard - 2 references

ULS: Unify Google

Unify Google Signup and Login flows.

Refs:

Tasks:

  • Create GoogleAuthenticator to contain:
    • Existing login logic. (#284, #286)
    • Existing signup logic. (#287)
  • Update logic to direct user to correct flows without failing.
    • Unify Google flows. (#295)
    • Add new Signup Confirmation view. (#298)
    • Redirect login to signup when no matching account. (#300)
  • Show Waiting for Google view for both Login and Signup. (#289)
  • Update Waiting for Google view (GoogleAuthViewController) to match new designs. (per @mattmiklic , this view can stay as-is.)
  • Update signup confirmation view (GoogleSignupConfirmationViewController) to match new designs. (#384)
  • Tracks. (wordpress-mobile/WordPress-iOS#14591, wordpress-mobile/WordPress-iOS#14592)
  • Accessibility.
    • GoogleSignupConfirmationViewController (#384)
    • GoogleAuthViewController

The Google flows uses these views (to be updated before enabling unified Google).

  • WP account login. (currently LoginWPComViewController) (#352)
  • 2FA code entry. (currently Login2FAViewController) (#336)

Continue with Google design from Zeplin:

Continue with Google


Current Waiting for Google view:

Simulator Screen Shot - iPhone 11 Pro Max - 2020-05-19 at 13 38 17

UL&S: Remove .startMagicLinkFlow

Remove the .startMagicLinkFlow storyboard segue from the storyboard and view controllers. Navigate using a navController instead.

Ref. #182

  • LoginEmailViewController
  • Remove enum case startMagicLinkFlow
  • Login.storyboard - 1 reference

UL&S: Remove `.showSigninV2`

Remove the .showSigninV2 storyboard segue from the storyboard and view controllers. Replace it with programmatic navigation.

Ref. #182

  • LoginEmailViewController
  • LoginPrologueViewController
  • enum case showSignupMethod
  • Login.storyboard - 2 references

UL&S: Remove .showWPComLogin

Remove the .showWPComLogin storyboard segue and LoginWPcomPassword storyboardID from the storyboard and view controllers. Navigate using a navController instead.

Ref. #182

.showWPComLogin

  • LoginEmailViewController
  • LoginPrologueViewController
  • LoginSiteAddressViewController
  • LoginViewController
  • Login.storyboard 3 segues
  • remove from StoryboardIdentifiers enum

LoginWPcomPassword

  • NUXLinkMailViewController
  • EmailMagicLink.storyboard 2 references
  • WordPressAuthenticator
  • Login.storyboard 1 reference

Spike: Duplicate Login, Signin, and NUX folders

Duplicate the storyboards and classes. Reconnect the IBOutlets, IBActions, and content views to their duplicated classes.

Screen Shot 2020-02-24 at 3 49 20 PM

Duplication Strategy:

  • Add a folder, Unified Login & Signup
  • Duplicate the classes and storyboards found in the Signin, Signup, and NUX folders
  • Prefix all class names with Auth
  • Reconnect IBOutlets, IBActions, content views, and class names in the duplicated storyboards
  • Rename NUX classes to ... (TBD)

Update the GoogleSignIn library when a version without UIWebView will be released

On Woo app, we continue to receive the message from Apple about the deprecated API usage for UIWebView.

It looks like GoogleSignIn does use UIWebView in their binaries:

-> % strings /Users/aaron/src/woocommerce-ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn  | grep -i uiwebview
l_OBJC_LABEL_PROTOCOL_$_UIWebViewDelegate
l_OBJC_PROTOCOL_$_UIWebViewDelegate
l_OBJC_LABEL_PROTOCOL_$_UIWebViewDelegate
l_OBJC_PROTOCOL_$_UIWebViewDelegate
UIWebViewDelegate
B40@0:8@"UIWebView"16@"NSURLRequest"24q32
v24@0:8@"UIWebView"16
v32@0:8@"UIWebView"16@"NSError"24
@"UIWebView"
T@"UIWebView",W,N,V_webView
... 

In their changelog I donโ€™t see any reference to UIWebView, so I believe that even updating to the latest version available (5.0.2), we will continue to see the warning.
The library will need to be updated when a version that does not use UIWebView will be available.

Customizable status bar styling

Expose a custom property that allows the host apps to set the status bar styling. Do this by:

  • Defining a new property in WordPressAuthenticatorStyles
  • Using the style property in a LoginViewController extension
  • In the WPiOS app, verify these changes do not affect / change the current styling
  • In the WCiOS app, remove the LoginViewController override and assign the new style property
override var preferredStatusBarStyle: UIStatusBarStyle {
        return AuthenticatorStyles.statusBarStyle
    }

Tokens should not print to console

Access tokens, bearer tokens, and token links should not print out in the console log, nor the Activity Logs.

Steps to reproduce

  1. Be logged out of a host app that uses SIWA
  2. Log in using SIWA
  3. Go to Me > Help & Support > Activity Logs > Current. Look for the JSON response printed out, with the fields bearer_token, token_links.

Expected: The values should be redacted
Actual: They are not redacted

UL&S: Remove `showURLUsernamePassword`

Remove the .showURLUsernamePassword storyboard segue from the storyboard and view controllers. Replace it with programmatic navigation.

Ref. #182

  • LoginEmailViewController
  • LoginSiteAddressViewController
  • enum case showURLUsernamePassword
  • Login.storyboard - 2 references

UL&S: Remove `.show2FA`

Remove the .show2FA storyboard segue from the storyboard and view controllers. Replace it with programmatic navigation.

Ref. #182

  • LoginViewController
  • NUXViewController - enum .show2FA
  • Login.storyboard - 5 references:
  • 1. LoginPrologueViewController
  • 2. LoginEmailViewController
  • 3. LoginSelfHostedViewController
  • 4. LoginWPComViewController (wp.com password screen)
  • 5. LoginUsernamePasswordViewController

UL&S: Remove .showSignupEmail

Ref. #182

Remove the showSignupEmail case from the SegueIdentifiers enum. Programmatically navigate to the SIgneupEmailViewController in the Signup.storyboard.

This case is used in 1 area:

  1. WPiOS signup
  • Login.storyboard
  • EmailLoginViewController
  • NUXViewController

UL&S: Site Address flow

Site Address Flow - Master Issue

Tracks Events

  • Add the new Tracks events to the Site Address flow (#386)

Base UI

Create the re-usable views that will be needed in the Site Address flow.

  • Create a flag to enable just the unified Site Address flow #285
  • Create a new blank viewController, SiteAddressViewController and navigate to it #293
  • Inside the viewController, add a tableview. Set autolayout leading / trailing margins to zero #294
  • Spike: @mattmiklic requests the continue button to attach to the keyboard for regular size classes and scroll for compact size classes. Research feasibility, estimations, and impact compared to pinning the button to the bottom of the screen. #296
  • Create the first uitableviewcell - InstructionTableViewCell #305
  • Add basic TextFieldTableViewCell #306
  • Add basic TextLinkButtonTableViewCell #308
    (and renamed InstructionTableViewCell to TextLabelTableViewCell)
  • Fix dynamic text bug in TextLinkButtonTableViewCell #310
  • Add basic ErrorLabelTableViewCell #312
  • Add support for iPad layouts. #334

Pages

  • SiteAddressViewController #312
  • SiteCredentialsViewController #322

UL&S: Remove .showWPUsernamePassword

Remove the .showWPUsernamePassword storyboard segue from the storyboard and view controllers. Navigate using a navController instead.

Ref. #182

  • Rename LoginUsernamePasswordViewController's storyboardID (wpUsernamePassword) to its class name
  • LoginSiteAddressViewController
  • Remove enum case showWPUsernamePassword
  • Login.storyboard - 2 references

Wrong error displayed for login attempts that exceed the login limit

If I attempt to log in to a WordPress.com account too many times in quick succession, my login attempts are blocked. However, in the UI I don't see the correct error message โ€” instead I see an incorrect password error. I observed the same issue in both the WordPress and WooCommerce apps.

Steps to reproduce:

  1. Create a WordPress.com account and set up 2FA. (I noticed this on an account with 2FA; I couldn't reproduce it as readily on an account without 2FA.)
  2. Log in to the account with your password.
  3. Log out.
  4. Repeat steps 2-3 several times.
  5. Eventually, you will exceed the login limit and will be stopped from logging in. Notice that the UI shows an error message about an incorrect password.
  6. Go to Help > Activity Logs > Current and notice that the actual error is about exceeding the login limit.

Error in the app logs:

You have exceeded the login limit. Please wait a few minutes and try again.

Error in the UI:

It seems like you've entered an incorrect password. Want to give it another try?

Screenshot from WordPress iOS internal v. 14.6.0.20200406:

Remove or disable the "Send Link" button for automattic email addresses

As a user, I find it confusing that the app says I can have a magic link emailed to me to verify my password but then when I try to do that an error message appears.

What I expect to happen:
The error message is more specific. Instead of "You're not allowed to request a login link for this account." It could say, "2-factor authentication is enabled on this account. Magic links cannot be sent for accounts using 2-factor authentication."

UL&S: Remove `.showSignupMethod`

Remove the .showSignupMethod storyboard segue from the storyboard and view controllers. Replace it with programmatic navigation.

Ref. #182

  • LoginEmailViewController
  • LoginPrologueViewController
  • enum .showSignupMethod
  • Login.storyboard - 2 references

NUX buttons are truncated on smaller devices

I just launched the app on the iPhone SE simulator, and noticed that the "continue with..." buttons in the NUX are truncated on smaller devices.

Per pbArwn-5X-p2, scale the button text to fit the width instead of truncating.

I guess we'll need to either wrap the text or shrink it when this happens.

Update GoogleSignIn pod

The declared version of GoogleSignIn is 4.1.2. It contains a warning, [!] GTMOAuth2 has been deprecated in favor of GTMAppAuth. Need an update for GoogleSignIn, to the latest version in order to remove the warning. It will need tested in both our host apps, WC / WP.

Jetpack Signup Flow pushes 3 buttons instead of present

After the Jetpack install flow, the user is asked to sign in again. The LoginEmailViewController is presented, and there text and a link below the email field that says, "Don't have an account? Sign up"

Tapping the "Sign up" link pushes the 3 button view instead of presenting the 3 button view. Pushing the nav creates the black screen (seen in Figure 2 below).

Steps to Reproduce

  1. Have a self-hosted site that doesn't have Jetpack connected. (This also works if you go to the site, Jetpack > and scroll to the bottom to find the "Disconnect" button and click it.)
  2. Log out of the WPiOS app if you are logged in.
  3. Log into the app through the self-hosted flow: Login > enter site address text link button
  4. After completing the login flow, go to the Notifications tab
  5. Follow the Jetpack install flow. Once it is successful, it will ask you to set up Jetpack.
  6. The "Set up" Jetpack button should navigate you to the email login screen. (See Figure 1 below)
  7. Tap the "Sign up" text link button.
    Expected: the 3 button view appears as an overlay to the email login screen.
    Actual: the 3 button view is pushed and the background is black.

Figure 1

Figure 2

Unified Login & Signup

Duplicate the code, with storyboards and classes #187


Spike / Research

  • Spike: take 5 days and attempt to break apart the Login.storyboard. The purpose is to discover the feasibility of the task.
  1. Remove the storyboard segues in Interface Builder and create programmatic ones.
  2. Remove the IBActions in Interface Builder and create programmatic ones.
  3. Remove delegates & datasources linked in Interface Builder and create programmatic ones.
  4. Remove Scenes from Interface Builder and move to their own nibs (.xib)
  5. Edit a ViewController and estimate how long it will take to make changes to the existing code.

0. Modify Epilogues in WPiOS.

1. Remove known segues. Replace with navController.

  • remove .showLoginEmail #205
  • remove .showSignupMethod #225
  • remove .showSigninV2 #232
  • remove .showGoogle #219
  • remove .showURLUsernamePassword #240
  • remove .showWPUsernamePassword #245
  • remove .showSelfHostedLogin #242
  • remove .showWPComLogin #273
  • remove .startMagicLinkFlow #256
  • remove .showMagicLink #254
  • remove .showLinkMailView #211
  • remove .show2FA #227
  • remove .showDomains #260
  • remove .showCreateSite #263
  • remove .showSignupEmail #265
  • remove .showUsernames #268
  • remove .showLoginMethod #270
  • some segues were added manually (didn't use the enum) and need changes (these were discovered when testing a removed segue and a crash happened during the navigation attempt)

2. Unify the flows

  • Google sign in #282
  • Sign in with Apple
  • WP.com login/signup
  • Site address #283

3. Button bottom sheet UI changes

  • Change "Log In" button text to "Log in with WordPress.com"
  • Change that button's action to navigate to Get Started screen
  • Remove the "3 button bottom sheet" from the "landing page"

WooCommerce authentication URL access

Hello,

I facing an issue that I don't understand the meaning : Some hosts have unnecessarily intrusive security checks in place that prevent WooCommerce API authentication from working (mod_security rule #1234234). If this check fails, you will not be able authorize Printful app = FAIL

capture d ecran 2018-06-03 a 17 14 21

Any Ideas ? Thanks

Conform to Community Standards

To promote consistency across WordPress-iOS frameworks & to conform to recommended community standards, we should update this repository to include all of the following:

  • Description
  • README
  • Code of conduct
  • Contributing
  • License
  • Issue templates
  • Pull request template

We should also modify the PR checks we have in place for consistency with WordPress-iOS (e.g., build checks, approval / merge requirements, etc.).

ULS: Update Navigation and Status Bars to new design

Update Navigation and Status Bars to new design.

Tasks:

  • Style navigation bar with large titles:
    • Add the ability to show Large Titles in the navigation bar. (#307)
    • Nav bar colors (#311, #314)
    • Update Help button text color. (#327)
    • Use New York font for large titles. (#316)
    • Remove host app icon. (#317)
    • Remove large titles. (#326)
  • Style status bar. (#330)

Issues:


Design from Zeplin:

unified_bar_style dark

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.