Git Product home page Git Product logo

cidaas / cidaas-sdk-ios-v2 Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 9.77 MB

With this SDK, you can integrate cidaas smoothly and with minimal effort into your IOS application. It enables you to map the most important user flows for OAuth2 and OIDC compliant authentication. Secure – Fast – And unrivaled Swabian.

Home Page: https://www.cidaas.com

License: MIT License

Ruby 0.25% Swift 99.75%
cidaas ios oauth2 oidc openid-connect

cidaas-sdk-ios-v2's People

Contributors

chandra9990 avatar cidaas-samples avatar ganeshkumargk avatar marvinwidas avatar muthukumarr271 avatar timo-kloss-endava avatar

Stargazers

 avatar  avatar

Watchers

 avatar

cidaas-sdk-ios-v2's Issues

Support SwiftUI

I'm attempting to integrate your SDK with SwiftUI and have encountered challenges with web view integration. As per my observations, instantiating a CidaasView without utilizing a storyboard seems to be problematic.

Could you kindly furnish a solution or guidelines for SwiftUI compatibility?

Crash when logged-in users update an app with the new SDK version

If a user logged in with an app using the old Cidaas SDK and then update to a version with the new Cidaas SDK, it will crash.

The problem is the function accessTokenModelToAccessTokenEntity:

One line was was changed from:
AccessTokenModel.shared.refresh_token = accessTokenEntity.refresh_token
to:
AccessTokenModel.shared.refresh_token = try! accessTokenEntity.refresh_token.aesEncrypt(key: key, iv: salt)

There is no fallback for old user data without encryption, and there is no error handling either. It just crashes.

The same seems to be true for access_token

Refresh token still encrypted when sending to API

The token refresh is broken, because "accessTokenModel.refresh_token" is still encrypted when using in "self.getAccessToken(refreshToken: ..."
It's only uncoded in "accessTokenModelToAccessTokenEntity"

`
public func getAccessToken(sub: String, callback: @escaping (Result) -> Void) {

    // getting current seconds
    let milliseconds = Date().timeIntervalSince1970
    let seconds = Int64(milliseconds)
    
    let accessTokenModel = DBHelper.shared.getAccessToken(key: sub)
    let expires = accessTokenModel.expires_in
    let secs: Int64 = Int64(accessTokenModel.seconds)
    let expires_in = expires + secs - 10
    
    if expires_in > seconds {
        
        if String(seconds).count < 10 {
            self.getAccessToken(refreshToken: accessTokenModel.refresh_token, callback: callback)
            return
        }
        
        EntityToModelConverter.shared.accessTokenModelToAccessTokenEntity(accessTokenModel: accessTokenModel) { (accessTokenEntity) in
            // return success callback
            let response = LoginResponseEntity()
            response.success = true
            response.status = 200
            response.data = accessTokenEntity
            
            DispatchQueue.main.async {
                callback(Result.success(result: response))
            }
            return
        }
    }
        
    else {
        self.getAccessToken(refreshToken: accessTokenModel.refresh_token, callback: callback)
    }
}

`

Wrong charset: Error with special characters for example in getUserInfo

The Cidaas API returns data in utf8, which is good, but it doesn't specify this in the response headers. The default parser in the SDK (in Alamofire) is some old ISO standard, so utf8 strings with special characters are parsed incorrectly.
At least the SDK should set the correct encoding. Even better would be, if the API sent the charset in its response headers.

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.