caapim / ios-mas-foundation Goto Github PK
View Code? Open in Web Editor NEWiOS Mobile SDK for CA Mobile API Gateway - MASFoundation Framework
Home Page: http://mas.ca.com
License: Other
iOS Mobile SDK for CA Mobile API Gateway - MASFoundation Framework
Home Page: http://mas.ca.com
License: Other
I am using MasFoundation framework in my app for certain reasons,
The library seems to for fine but has one issue while I am trying to use the login method i.e as stated in the documentation
I am using swift 4 however when I send passwords includind "&" and "+" in thier method, it gets truncated to before the characters and sends the half string
for eg if Password is "P&ssword", the server will only receive P in thier login request, however if password is "P@ssword", it will work perfectly
I tried using .addingPercentEncoding(withAllowedCharacters: ) but to no avail, Can anyone help?
This is not an issue, just a question.
We are implementing MAS/MAG/RAS SDK at a customer, and to fulfill some networking infrastructure requirements (Firewall/WAF/Reverse Proxy...) our customer is asking if the "Mobile SDK for CA Mobile API Gateway" (https://mas.ca.com) supports SNI (Server Name Indication).
We couldn't find this information in the official documentation.
By our searches in the Official Documentation and CA Communities site, we believe that CA API Gateway (Server) does not have SNI support, but the question above is specific for the Mobile Client SDK (Android/iOS/etc).
SNI can be described as:
SNI stands for Server Name Indication and is an extension of the TLS protocol. It indicates which hostname is being contacted by the browser (client) at the beginning of the 'handshake'-process.
This allows a server to present multiple certificates on the same IP address and TCP port number and hence allows multiple secure websites to be served off the same IP address without requiring all those sites to use the same certificate.
What we want to know is:
In the above scenario (SNI-enabled server serving multiple HTTPS hosts), if a client using MAS SDK connects to this server, it will, during TLS handshake, provide server name information to the server, which, in turn, will present the righ SSL certificate to the SDK?
Meaning "does MAS SDK HTTP(S) Client Libraries supports and uses SNI by default?"
If the Mobile Client SDK supports SNI, we need to know if there is any limitation.
We already got an answer for the same question for the Android SDK (CAAPIM/Android-MAS-SDK#268)
Best Regards,
Marlos Chida
I'd like to be able to integrate this SDK with Swift Package Manager.
Testing itegrations
The current published CocoaPod for MASFoundation is 1.2.01 and only includes references to MASFoundation.h:
If you add "MASFoundation" to the podfile when using the MASStarter template
target 'MASStarter' do
use_frameworks!
pod 'DGActivityIndicatorView'
pod 'SABlurImageViewObjc'
pod 'SCLAlertView-Objective-C'
pod 'MASFoundation'
end
you will get:
#import <MASFoundation/MAS.h> 'MASFoundation/MAS.h' file not found
We keep experiencing issues with the login api from the SDK
following is snippet of the same
Error Domain=com.ca.MASFoundation:ErrorDomain Code=3003107 "The registered device record is invalid" UserInfo={status-code=400, MASResponseInfoBodyInfoKey={
error = "invalid_request";
"error_description" = "The given mag-identifier is either invalid or points to an unknown device";
}
can you please help us with some info regarding this
Hello,
I have to send a json array inside the request body.
It seems the MASRequest body attribute only accepts a dictionary.
How can I accomplish that?
I was able to do that effortless on Android SDK.
Thanks
MASFoundation 1.9.00
What is happening
I am trying to login a user using the MAS SDK.
I am using the function loginWithUserName from the MASUser.
When I try to login, my app crashes and I get the following debug output:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[_NSZeroData subdataWithRange:]: range {1, 18446744073709551615} causes integer overflow'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 Foundation 0x00007fff255ddb3c -[NSData(NSData) writeToFile:options:error:] + 0
3 MASFoundation 0x000000010e7a1557 -[MASASN1Decoder parseWithRange:] + 2359
4 MASFoundation 0x000000010e7a0be8 -[MASASN1Decoder decodeASN1] + 216
5 MASFoundation 0x000000010e6e7d61 -[MASDERCertificate parseCertificateData] + 257
6 MASFoundation 0x000000010e7a57ce -[MASDevice(MASPrivate) saveWithUpdatedInfo:] + 1470
7 MASFoundation 0x000000010e748152 __63-[MASAuthCredentials(MASPrivate) registerDeviceWithCredential:]_block_invoke + 1474
8 MASFoundation 0x000000010e730679 __147-[MASNetworkingService sessionDataTaskCompletionBlockWithEndPoint:parameters:headers:httpMethod:requestType:responseType:isPublic:completionBlock:]_block_invoke + 8633
9 MASFoundation 0x000000010e7b057f __67-[MASURLSessionManager dataOperationWithRequest:completionHandler:]_block_invoke + 255
10 MASFoundation 0x000000010e77f1e8 __68-[MASSessionDataTaskOperation URLSession:task:didCompleteWithError:]_block_invoke.419 + 104
11 libdispatch.dylib 0x000000010e9a7df0 _dispatch_call_block_and_release + 12
12 libdispatch.dylib 0x000000010e9a8d64 _dispatch_client_callout + 8
13 libdispatch.dylib 0x000000010e9b6b11 _dispatch_main_queue_callback_4CF + 721
14 CoreFoundation 0x00007fff23afb699 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
15 CoreFoundation 0x00007fff23af62f9 __CFRunLoopRun + 2329
16 CoreFoundation 0x00007fff23af56b6 CFRunLoopRunSpecific + 438
17 GraphicsServices 0x00007fff3815cbb0 GSEventRunModal + 65
18 UIKitCore 0x00007fff47162a67 UIApplicationMain + 1621
19 rnt 0x000000010d569d10 main + 112
20 libdyld.dylib 0x00007fff5123bcf5 start + 1
21 ??? 0x0000000000000001 0x0 + 1
What should happen
The sdk should login correctly and return a MASUser object.
Does anyone know how to fix this?_
Greetings,
In Android MAS SDK It's possible to set requests connect and read timeouts globally, using something like this:
MAS.setConnectionListener(new MASConnectionListener() {
@Override
public void onObtained(HttpURLConnection connection) {
connection.setConnectTimeout(2000);
connection.setReadTimeout(2000);
}
}
Using this code, implicit requests (like initialize, register, login...) also use this timeout values. Is it possible to achieve the same behavior in iOS MAS SDK?
Testing email notifications.
Hi,
I'm getting the error message: An SSL error has occurred, this may be caused by attempting to connect to a server using TLS version below 1.2.
How can I force the use of the TLS 1.2 version?
Hi all,
recently I have got the following error:
"UserInfo={NSLocalizedDescription=Failed to verify bitcode in MASFoundation.framework/MASFoundation:
error: Linker option verification failed for bundle /var/folders/63/1jskwlm14l1939nl96hy4zqw0000gn/T/MASFoundationhvZjDr/MASFoundation.armv7.xar (unrecognized arguments: -platform_version iOS 9.0.0 13.0.0)}
Please can you help me?
Hi Support Team,
I have been using MAG SDK for my iOS application, It seems there is bug in SDK. Renwal process uses "PUT" method and request and response type is JSON, however type being received for client certificate is text/plain in renewal process.
I have tried to change response type to text/plain, i was able to receive certificate but it somehow stop other operation to work.
So we have one api that throws error code 206, which eventually trigger renewal process which causes above mentioned error.
please help me to resolve this issue.
PR: #291
Currently the MASRequest builder only accepts an NSDictionary
as the request body. This is an issue as not all (of our) endpoints expect a dictionary as the root object of a request's body.
Some possible fixes could be to:
id
as the body's type (this change does not existing impact users when they update).NSData
as the body's type (breaking change and users have to encode the json themselves. Offers flexibility however).JSONObject
class as the body's type (JSONObject would then be initializable with all valid json data types: NSNumber
, NSString
, Bool
, NSDictionary
, NSArray
, etc. This limits the amount of "valid" types a user could use to set the request body):@interface MASJsonObject: NSObject @property (nonatomic, strong) id value; - (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithString:(NSString *)string; - (instancetype)initWithBool:(BOOL)boolean; - (instancetype)initWithNumber:(NSNumber *)number; - (instancetype)initWithDictionary:(NSDictionary *)dictionary; - (instancetype)initWithArray:(NSArray *)array; @end @implementation MASJsonObject - (instancetype)initWithString:(NSString *)string { self = [super init]; if (self) { self.value = string; } return self; } // etc... @end
Try building on Apple Silicon and linking to current release framework.
Could you please add pods for version 1.6.10 for:
MASUI
MASConnecta
MASIdentityManagement
MASStorage
MASFoundation
Could you make all or some of the codes in NSError+MASPrivate.m
publicly available? It would be useful. For instance, I could handle for my needs a timed out request or sudden lack of Internet connection by comparing the error code to your constants.
Thanks for your attention o/
Hi,
I could find (on MAS for android) a way to send multipart/formdata creating the request using MASRequest and the body using MASRequestBody. But could find that classes on iOS.
It would be great if the lib could support multipart/formdata iOS.
Example:
=== msso_config.json snippet ==
"server": {
"hostname": "api.yourhost.com",
"port": 8443,
"prefix": "ext",
While this works when doing standard login flows, etc. the default behavior of a MAS.getFrom or .postTo, etc causes any API call (ex. MAS.getFrom("/api"...) to require the API to actually be located at "/ext/api".
The default behavior should be to defer to the absolute path being passed.
Good Morning,
I'm having a device runing iOS 13 beta 1 to test compability, but the MASUser.login doesn't work, but on the current iOS 12.3, it works just fine.
I know that the beta was released yesterday, just want to warning about the problem.
MASUser.login(with: credentials, completion: { (completed, error) in
if (!completed) {
if (error != nil) {
onError()
}
} else {
if (error == nil) {
onSuccess()
}
}
})
The completed is returning false
, and the error is returning the following:
Error Domain=com.ca.MASFoundation.localError:ErrorDomain Code=-999 "SSL pinning validation failed: ensure the target domain’s MASSecurityConfiguration is correctly configured." UserInfo={NSLocalizedDescription=SSL pinning validation failed: ensure the target domain’s MASSecurityConfiguration is correctly configured., status-code=0}
for email notification test
Hi Support Team,
I have been using MAG SDK for my iOS application, It seems there is bug in SDK. Renwal process uses PUT method and request and response type is JSON, however type being received for client certificate is text/plain in renewal process.
I have tried to change response type to text/plain, i was able to receive certificate but it somehow stop other operation to work.
So we have one api that throws error code 206, which eventually trigger renewal process which causes above mentioned error.
please help me to resolve this issue.
I'd like to be able to use ASWebAuthenticationSession instead of WKWebView as browser based authentication method.
This reason for this request is that ASWebAuthenticationSession is better at keeping cookies alive then WKWebView
And ASWebAuthenticationSession is developed by apple explicitly for the authentication usecase
More information on this API: https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession
Hi, I had opened an issue related to the truncation of password or username if the special character '&' is passed in password through your SDK, the link is as below
#126
I understand you made a fix by using the native iOS encoding using stringByAddingPercentEncodingWithAllowedCharacters for character set "!*'();:@&=+$,/?%#[] " in your function
escapeValueForURLParameter however this has not helped resolve the issue and I believe the issue is at another place as I have been going through your code and I realized the method
[[MASNetworkingService sharedService] postTo:registerEndpoint
withParameters:parameterInfo
andHeaders:headerInfo
requestType:MASRequestResponseTypeTextPlain
responseType:MASRequestResponseTypeTextPlain
completion:^(NSDictionary<NSString *,id> * _Nullable responseInfo, NSError * _Nullable error) {}];
Throws an error of 401 unauthorized, when trying to call data
and hence never reaches the method escapeValueForURLParameter where you have made the fix for the previous opened issue, can you please Help us out as to why it returns unautorized at this point.
In my company, we have a project that uses MASFoundation combined with some analytics libraries. One of these libraries, Dynatrace, have a conflict in the mentioned function. This conflict cause an invalidation on the CSR generation, because the implementation on the Dynatrace's library don't append the bytes for type and size of the contents and the obtained result have two bites less than necessary. My suggestion is change the declaration of the function to avoid this conflicts.
Hi,
We are using 1.9.10 version of your library MASFoundation, and we keep encountering this error
Failed to verify bitcode in MASFoundation.framework/MASFoundation:
error: Linker option verification failed for bundle /var/folders/63/1jskwlm14l1939nl96hy4zqw0000gn/T/MASFoundationopqylu/MASFoundation.armv7.xar (unrecognized arguments: -platform_version iOS 9.0.0 13.0.0)
Upgrading to 1.9.20, did not help, the started occurring after the release of iOS 13
Can you please let us know what could be the possible reason for it.
Instead of overwriting a session, the MAS.loginWithCompletion will continue with an already logged in session even if you attempt to authenticate a new user. Actual behavior should likely be to overwrite existing user in favor of the new user being logged in.
As the title says, all the logs emitted when running on the simulator are not available when running on the device. Is there a workaround for this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.